OSDN Git Service

Initialize the buffer
authorSanket Padawe <sanketpadawe@google.com>
Wed, 27 Jan 2016 01:32:50 +0000 (17:32 -0800)
committerSanket Padawe <sanketpadawe@google.com>
Wed, 27 Jan 2016 01:32:50 +0000 (17:32 -0800)
Initialize the char array to null character
as there is a possibility that it is not null
terminated

BUG=21063589

Change-Id: I00cc699795c5c266ac7adae2a0ce6f13ee187e1f

rild/rild.c

index c63da38..bf9c421 100644 (file)
@@ -200,7 +200,7 @@ int main(int argc, char **argv) {
 #define  REFERENCE_RIL_PATH  "libreference-ril.so"
 
         /* first, read /proc/cmdline into memory */
-        char          buffer[1024], *p, *q;
+        char          buffer[1024] = {'\0'}, *p, *q;
         int           len;
         int           fd = open("/proc/cmdline",O_RDONLY);