Fixed string size for keyboard option parser
This commit is contained in:
parent
967749d43f
commit
605ff25269
@ -2042,11 +2042,12 @@ static int parse_kbd_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_
|
||||
{
|
||||
const size_t olen = strlen(old);
|
||||
const size_t alen = strlen(now);
|
||||
char* tmp = calloc(olen + alen + 1, sizeof(char));
|
||||
const size_t tlen = olen + alen + 2;
|
||||
char* tmp = calloc(tlen, sizeof(char));
|
||||
if (!tmp)
|
||||
rc = COMMAND_LINE_ERROR_MEMORY;
|
||||
else
|
||||
_snprintf(tmp, olen + alen + 1, "%s,%s", old, now);
|
||||
_snprintf(tmp, tlen, "%s,%s", old, now);
|
||||
now = tmp;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user