From 323c882404bf5f979bc49a8a49ea202c7d40cbcc Mon Sep 17 00:00:00 2001 From: Ajay Nambi Date: Wed, 5 Aug 2015 14:53:50 +0530 Subject: [PATCH] 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 --- ril/libril/ril.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ril/libril/ril.cpp b/ril/libril/ril.cpp index c3f50ba1..716f37d9 100644 --- a/ril/libril/ril.cpp +++ b/ril/libril/ril.cpp @@ -110,7 +110,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