summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-03-29 21:06:36 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-03-29 21:06:36 +0000
commitef41ad91dbf5b6a5b4e23a70ac0e9a4824e940d3 (patch)
tree3faf6aa83992b1b161624ad1fa2d18fa981d52c6 /tools
parentd8a053351e359316c663ec9f28f91cac008907df (diff)
downloadrockbox-ef41ad91dbf5b6a5b4e23a70ac0e9a4824e940d3.tar.gz
rockbox-ef41ad91dbf5b6a5b4e23a70ac0e9a4824e940d3.tar.bz2
rockbox-ef41ad91dbf5b6a5b4e23a70ac0e9a4824e940d3.zip
Fix strcpy from a user-supplied string to fixed size string.
Author: Marcin Bukat Flyspray: FS#11151 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25389 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/scramble.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/scramble.c b/tools/scramble.c
index ca3fd3bb35..ed972f7768 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -333,7 +333,8 @@ int main (int argc, char** argv)
return 2;
}
/* we store a 4-letter model name too, for humans */
- strcpy(modelname, &argv[1][5]);
+ strncpy(modelname, &argv[1][5],4);
+ modelname[4] = '\0'; /* to be sure we are null terminated */
chksum = modelnum; /* start checksum calcs with this */
}