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
tirimbino
Ajay Nambi 9 years ago committed by Christopher N. Hesse
parent 022eadd458
commit 323c882404
  1. 2
      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

Loading…
Cancel
Save