mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
prevent storing IDs that are higher than we have knowledge about!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2620 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dade571a99
commit
c7e0bea57a
1 changed files with 2 additions and 1 deletions
|
@ -43,7 +43,8 @@ int lang_load(char *filename)
|
||||||
while(filesize>3) {
|
while(filesize>3) {
|
||||||
id = (ptr[0]<<8) | ptr[1]; /* get two-byte id */
|
id = (ptr[0]<<8) | ptr[1]; /* get two-byte id */
|
||||||
ptr+=2; /* pass the id */
|
ptr+=2; /* pass the id */
|
||||||
language_strings[id] = ptr; /* point to this string */
|
if(id < LANG_LAST_INDEX_IN_ARRAY)
|
||||||
|
language_strings[id] = ptr; /* point to this string */
|
||||||
while(*ptr) { /* pass the string */
|
while(*ptr) { /* pass the string */
|
||||||
filesize--;
|
filesize--;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue