diff options
author | Javier Ferrer <javi.f.o@gmail.com> | 2013-05-21 01:09:24 +0200 |
---|---|---|
committer | Javier Ferrer <javi.f.o@gmail.com> | 2013-05-21 01:09:24 +0200 |
commit | 76ea68e99b6ab1c16efcdb67485e18574c9e0865 (patch) | |
tree | 55a46d1559525505c6c3af80edd2d5e575540f27 | |
parent | cfaad78bbb6b4cb19eaff2782a82a22131fba823 (diff) | |
download | hardware_samsung-76ea68e99b6ab1c16efcdb67485e18574c9e0865.zip hardware_samsung-76ea68e99b6ab1c16efcdb67485e18574c9e0865.tar.gz hardware_samsung-76ea68e99b6ab1c16efcdb67485e18574c9e0865.tar.bz2 |
Fix macloader buffer overflow
Fixes this log entries.
I/macloader( 1915): Writing murata to /data/.cid.info
D/macloader( 1915): Setting permissions on /data/.cid.info
F/libc ( 1915): *** vsprintf buffer overflow detected ***
F/libc ( 1915): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 1915 (macloader)
Change-Id: I1ccb257bada18030de76a2be40477172993ca2a0
-rw-r--r-- | macloader/macloader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/macloader/macloader.cpp b/macloader/macloader.cpp index 62397cd..b316c60 100644 --- a/macloader/macloader.cpp +++ b/macloader/macloader.cpp @@ -117,8 +117,8 @@ int main() { amode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; ret = chmod(CID_PATH, amode); - char* chown_cmd = (char*) malloc(strlen("chown system ") + strlen(CID_PATH)); - char* chgrp_cmd = (char*) malloc(strlen("chgrp system ") + strlen(CID_PATH)); + char* chown_cmd = (char*) malloc(strlen("chown system ") + strlen(CID_PATH) + 1); + char* chgrp_cmd = (char*) malloc(strlen("chgrp system ") + strlen(CID_PATH) + 1); sprintf(chown_cmd, "chown system %s", CID_PATH); sprintf(chgrp_cmd, "chgrp system %s", CID_PATH); system(chown_cmd); |