[Lux US STA] Fix Svace issue 39/180839/2
authorJihoon Jung <jh8801.jung@samsung.com>
Mon, 4 Jun 2018 23:12:43 +0000 (08:12 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Fri, 15 Jun 2018 02:43:17 +0000 (11:43 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I87c79988f9cbf63e5080b5c8cf51a6907178a9e3

packaging/mtp-responder.spec
src/mtp_init.c

index 1cc2c676a7e0f23de167400cd2e68abe3d810f9d..567671bdd5d457ff06271b127684c8356dd92dbf 100755 (executable)
@@ -5,12 +5,12 @@ ExcludeArch: %arm aarch64
 
 Name:       mtp-responder
 Summary:    Media Transfer Protocol daemon (responder)
-Version:    0.0.29
+Version:    0.0.30
 Release:    1
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
-Source1001:    %{name}.manifest
+Source1001: %{name}.manifest
 BuildRequires: cmake
 BuildRequires: libgcrypt-devel
 BuildRequires: pkgconfig(glib-2.0)
index c2643beaab62e2d63d8973f2e746347ae7d41d9d..1fca0d2e82f184b3303221dce43ea532d4182f4d 100755 (executable)
@@ -331,66 +331,114 @@ static void __read_mtp_conf(void)
 
                if (strcasecmp(token, "mmap_threshold") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.mmap_threshold = atoi(token);
 
                } else if (strcasecmp(token, "init_rx_ipc_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.init_rx_ipc_size = atoi(token);
 
                } else if (strcasecmp(token, "init_tx_ipc_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.init_tx_ipc_size = atoi(token);
 
                } else if (strcasecmp(token, "max_rx_ipc_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.max_rx_ipc_size = atoi(token);
 
                } else if (strcasecmp(token, "max_tx_ipc_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.max_tx_ipc_size = atoi(token);
 
                } else if (strcasecmp(token, "read_usb_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.read_usb_size = atoi(token);
 
                } else if (strcasecmp(token, "write_usb_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.write_usb_size = atoi(token);
 
                } else if (strcasecmp(token, "read_file_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.read_file_size = atoi(token);
 
                } else if (strcasecmp(token, "write_file_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.write_file_size = atoi(token);
 
                } else if (strcasecmp(token, "max_io_buf_size") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.max_io_buf_size = atoi(token);
 
                } else if (strcasecmp(token, "read_file_delay") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.read_file_delay = atoi(token);
 
                } else if (strcasecmp(token, "support_pthread_sched") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.support_pthread_sched = atoi(token) ? true : false;
 
                } else if (strcasecmp(token, "inheritsched") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.inheritsched = *token;
 
                } else if (strcasecmp(token, "schedpolicy") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.schedpolicy = *token;
 
                } else if (strcasecmp(token, "file_schedparam") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.file_schedparam = atoi(token);
 
                } else if (strcasecmp(token, "usb_schedparam") == 0) {
                        token = strtok_r(NULL, "=", &saveptr);
+                       if (token == NULL)
+                               continue;
+
                        g_conf.usb_schedparam = atoi(token);
 
                } else {