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.
Bug:23289936
Change-Id: I25430a5c6f2a8b19a3271235323499b6ee802746
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 30b4220..9b05829 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -109,7 +109,7 @@
#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