Complete bool string when joining it 96/267896/1 accepted/tizen/6.5/unified/20211215.125408 submit/tizen_6.5/20211213.045749
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 13 Dec 2021 04:26:21 +0000 (13:26 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 13 Dec 2021 04:35:04 +0000 (04:35 +0000)
Change-Id: I203742d0bbcaa734871ea045a1b26e3c82f6a81c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit b300cfff4c5633377c1b19324d63958f200fac39)

src/system_info.c

index a5eb2179a37b2b1944aaa6ef85f6f7961baa2bd6..7b028c8a38756231f5935760560fa1c760d521fe 100644 (file)
@@ -92,7 +92,7 @@ static int db_join_value(const char *value_platform, const char *value_hal, cons
 
        /* If the type is bool type, then
         * the result is AND of those two value */
-       if (len < LANG_MAX || strlen(value_platform) < LANG_MAX || strlen(value_hal) < LANG_MAX)
+       if (len <= LANG_MAX || strlen(value_platform) < LANG_MAX || strlen(value_hal) < LANG_MAX)
                return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
 
        for (i = 0; i < LANG_MAX; ++i) {
@@ -101,6 +101,9 @@ static int db_join_value(const char *value_platform, const char *value_hal, cons
                out[i] = (platform && hal) ? 'T' : 'F';
        }
 
+       for (i = LANG_MAX; i < len; ++i)
+               out[i] = '\0';
+
        return SYSTEM_INFO_ERROR_NONE;
 }