mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
channels/rdpdr: replace usage of strndup
This commit is contained in:
@@ -307,6 +307,7 @@ static char* get_word(char* str, unsigned int* offset)
|
||||
{
|
||||
char* p;
|
||||
char* tmp;
|
||||
char* word;
|
||||
int wlen;
|
||||
|
||||
if (*offset >= strlen(str))
|
||||
@@ -325,7 +326,15 @@ static char* get_word(char* str, unsigned int* offset)
|
||||
while (*(str + *offset) == ' ')
|
||||
(*offset)++;
|
||||
|
||||
return strndup(p, wlen);
|
||||
word = malloc(wlen + 1);
|
||||
|
||||
if (word != NULL)
|
||||
{
|
||||
CopyMemory(word, p, wlen);
|
||||
word[wlen] = '\0';
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
|
||||
static void handle_hotplug(rdpdrPlugin* rdpdr)
|
||||
|
||||
Reference in New Issue
Block a user