From: Seonah Moon Date: Tue, 7 Jan 2025 08:34:26 +0000 (+0900) Subject: Fix svace issue X-Git-Tag: accepted/tizen/unified/20250114.104241^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified;p=platform%2Fcore%2Fapi%2Fvpn-service.git Fix svace issue Change-Id: I702a8048d2c4a6ee224a3fbeb56610095512f6a0 --- diff --git a/packaging/capi-vpn-service.spec b/packaging/capi-vpn-service.spec index 033fc2f..9114989 100755 --- a/packaging/capi-vpn-service.spec +++ b/packaging/capi-vpn-service.spec @@ -1,6 +1,6 @@ Name: vpnsvc-pkg Summary: VPN service library in TIZEN C API -Version: 1.2.0 +Version: 1.2.1 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/tools/vpn_service_test.c b/tools/vpn_service_test.c index 1bec5fa..402c3e6 100755 --- a/tools/vpn_service_test.c +++ b/tools/vpn_service_test.c @@ -513,7 +513,6 @@ int test_exit() exit(0); } - int (*test_function_table[])(void) = { test_vpnsvc_init, test_vpnsvc_deinit, @@ -573,7 +572,8 @@ int main() TEST_CONSOLE_INPUT(input, 3); unsigned int comm = strtoul(input, NULL, 0); - if (comm <= 0 || comm > (sizeof(test_function_table) / sizeof(int))) { + if ((comm == ULONG_MAX && errno == ERANGE) || comm <= 0 + || comm >= sizeof(test_function_table)/sizeof(*test_function_table)) { if (input[0] == 'q') { test_exit(); return 0; @@ -583,7 +583,7 @@ int main() continue; } - int rv = test_function_table[comm-1](); + int rv = test_function_table[comm - 1](); if (rv == 1) printf("Operation succeeded!\n"); else