Fix svace issue 08/224508/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.110016 accepted/tizen/6.0/unified/hotfix/20201102.233621 accepted/tizen/6.0/unified/hotfix/20201103.050457 accepted/tizen/unified/20200225.224329 submit/tizen/20200224.073206 submit/tizen_6.0/20201029.205502 submit/tizen_6.0_hotfix/20201102.192902 submit/tizen_6.0_hotfix/20201103.115102 tizen_6.0.m2_release
authorYunmi Ha <yunmi.ha@samsung.com>
Tue, 11 Feb 2020 06:46:35 +0000 (15:46 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Tue, 11 Feb 2020 06:46:35 +0000 (15:46 +0900)
- Fix variable type for saving nagative return

Change-Id: I2b01f765c3830b54561bfdba4776368c4489d0f3
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/daemon/main.c

index e74189a..b13b607 100755 (executable)
@@ -162,9 +162,12 @@ main (int argc, char **argv)
     struct group buf_group;
     gchar *buf = NULL;
     gchar *tmp = NULL;
-    gsize buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-    if (buflen<sizeof(struct group))
+    gsize buflen = 0;
+    long gr_max = sysconf(_SC_GETGR_R_SIZE_MAX);
+    if (gr_max < sizeof(struct group))
         buflen = 1024;
+    else
+        buflen = gr_max;
 
 #if !GLIB_CHECK_VERSION (2, 36, 0)
     g_type_init ();