Fix getting pkgtype from request 13/103413/1
authorSangyoon Jang <s89.jang@samsung.com>
Thu, 8 Dec 2016 08:26:01 +0000 (17:26 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Thu, 8 Dec 2016 08:30:37 +0000 (17:30 +0900)
Change-Id: I9d85af7f9da1f5c7615ee1d3c403054dc673e8d6
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/request.c

index f7c10fb..7fb6e20 100644 (file)
@@ -322,7 +322,7 @@ static int __handle_request_install(uid_t caller_uid,
        }
 
        pkgtype = _get_pkgtype_from_file(pkgpath);
-       if (!pkgtype && arg_pkgtype)
+       if (!pkgtype && arg_pkgtype && strlen(arg_pkgtype))
                pkgtype = (const char *)arg_pkgtype;
        if (pkgtype == NULL) {
                g_dbus_method_invocation_return_value(invocation,
@@ -411,7 +411,7 @@ static int __handle_request_mount_install(uid_t caller_uid,
        }
 
        pkgtype = _get_pkgtype_from_file(pkgpath);
-       if (!pkgtype && arg_pkgtype)
+       if (!pkgtype && arg_pkgtype && strlen(arg_pkgtype))
                pkgtype = (const char *)arg_pkgtype;
        if (pkgtype == NULL) {
                g_dbus_method_invocation_return_value(invocation,