Fix possible corruption 14/169214/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 5 Feb 2018 04:51:47 +0000 (13:51 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 5 Feb 2018 04:51:47 +0000 (13:51 +0900)
- Memory corruption tool detects that
  local char array could be uninitialized even if
  g_io_channel_read_chars returns G_IO_STATUS_NORMAL
  so it should be initialized at declaration.

Change-Id: I927bbb174d0e657b47f27ed42739f503e9fdf6d6
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkgmgr-server.c

index 0ac356f..7a024d9 100644 (file)
@@ -237,7 +237,7 @@ static gboolean getsize_io_handler(GIOChannel *io, GIOCondition cond,
        GError *err = NULL;
        GIOStatus s;
        gsize len;
-       char buf[MAX_LONGLONG_LENGTH];
+       char buf[MAX_LONGLONG_LENGTH] = {0};
        long long result = 0;
        struct backend_job *job = (struct backend_job *)data;
        struct getsize_sync_extra_info *extra_getsize_info =