summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-10-14 12:20:53 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-10-14 12:20:53 +0000
commitc7e0bea57ad383593ebf8c106a4cccf8bcd46ba1 (patch)
tree32b0ead68aa4d8402ca187e7949ed9c814a18e1d /apps
parentdade571a99b46ad5ae70ba6b36e0653ddce6c47b (diff)
downloadrockbox-c7e0bea57ad383593ebf8c106a4cccf8bcd46ba1.tar.gz
rockbox-c7e0bea57ad383593ebf8c106a4cccf8bcd46ba1.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/language.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/language.c b/apps/language.c
index df8c32a05e..6ac8550e55 100644
--- a/apps/language.c
+++ b/apps/language.c
@@ -43,7 +43,8 @@ int lang_load(char *filename)
43 while(filesize>3) { 43 while(filesize>3) {
44 id = (ptr[0]<<8) | ptr[1]; /* get two-byte id */ 44 id = (ptr[0]<<8) | ptr[1]; /* get two-byte id */
45 ptr+=2; /* pass the id */ 45 ptr+=2; /* pass the id */
46 language_strings[id] = ptr; /* point to this string */ 46 if(id < LANG_LAST_INDEX_IN_ARRAY)
47 language_strings[id] = ptr; /* point to this string */
47 while(*ptr) { /* pass the string */ 48 while(*ptr) { /* pass the string */
48 filesize--; 49 filesize--;
49 ptr++; 50 ptr++;