forked from len0rd/rockbox
[Bugfix] theme %ss will overflow buffer, update %ft manual entry
%ss did not check for the size of the resulting string before copying it to the buffer %ft has a search text mode Change-Id: I1321681c249251aafe0e39bcc510b9e81f0cd0d3
This commit is contained in:
parent
50515de940
commit
dfd01709c5
2 changed files with 16 additions and 7 deletions
|
|
@ -823,7 +823,11 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
byte_len = end_byte - start_byte;
|
||||
|
||||
if (token_val != buf)
|
||||
{
|
||||
if (byte_len >= buf_size) /* the resulting string exceeds buf */
|
||||
return &token_val[start_byte]; /* just return the string */
|
||||
memcpy(buf, &token_val[start_byte], byte_len);
|
||||
}
|
||||
else
|
||||
buf = &buf[start_byte];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue