Fix svace issue 54/317754/1 accepted/tizen_9.0_unified tizen_9.0 accepted/tizen/9.0/unified/20250114.155923
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 7 Jan 2025 08:34:26 +0000 (17:34 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Tue, 7 Jan 2025 08:40:12 +0000 (17:40 +0900)
Change-Id: I702a8048d2c4a6ee224a3fbeb56610095512f6a0

packaging/capi-vpn-service.spec
tools/vpn_service_test.c

index 033fc2f4d91ae64e0ffdb92d108f812049138dd7..91149891ed2342a1ee78503be6b179f14d525f67 100755 (executable)
@@ -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
index 1bec5fac30e0c287f054cdcd982e1cbc6d879bee..402c3e6b9a2892d9dd74947283a07230a71c8ec2 100755 (executable)
@@ -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