From 53bd0adb17e42249b6a43cdcffbc076031226978 Mon Sep 17 00:00:00 2001 From: Sindhu Kanathur Date: Tue, 10 Dec 2013 15:03:17 +0530 Subject: Initialize the buffer Initialize the char array to null character as there is a possibility that it is not null terminated. Change-Id: If1eca2b2f3ec22bafeb303da02deb62f0655241c CRs-Fixed: 584311 --- rild/rild.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rild/rild.c b/rild/rild.c index fa9d72a..f9d226d 100644 --- a/rild/rild.c +++ b/rild/rild.c @@ -163,7 +163,7 @@ int main(int argc, char **argv) #define REFERENCE_RIL_PATH "/system/lib/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); -- cgit v1.2.3