diff options
author | Prasath Balakrishnan <bpras@codeaurora.org> | 2015-08-05 14:53:50 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:20:16 -0600 |
commit | f8a2794a63a2ffe5ca2a4b34d3dfe6bccd0b7b55 (patch) | |
tree | c1f46c1bfdfffdcc38f416acceb71119fdfd6d6c | |
parent | b31c3240ab910775fe1ffc5c50058cbb8ca7444f (diff) | |
download | android_hardware_ril-f8a2794a63a2ffe5ca2a4b34d3dfe6bccd0b7b55.tar.gz android_hardware_ril-f8a2794a63a2ffe5ca2a4b34d3dfe6bccd0b7b55.tar.bz2 android_hardware_ril-f8a2794a63a2ffe5ca2a4b34d3dfe6bccd0b7b55.zip |
Fix for rild crash becasue of buffer overflow
There is a buffer overflow which causing rild crash. For
appendPrintBuf, "sprintf" is replaced with "snprintf" for
the safe copy operation.
Change-Id: I25430a5c6f2a8b19a3271235323499b6ee802746
CRs-Fixed: 881515
-rwxr-xr-x | libril/ril.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp index 62c51de..c9e4a87 100755 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -109,7 +109,7 @@ namespace android { #define clearPrintBuf printBuf[0] = 0 #define removeLastChar printBuf[strlen(printBuf)-1] = 0 - #define appendPrintBuf(x...) sprintf(printBuf, x) + #define appendPrintBuf(x...) snprintf(printBuf, PRINTBUF_SIZE, x) #else #define startRequest #define closeRequest |