Check parameter validity to prevent crash 98/152698/1 accepted/tizen/unified/20170929.081638 submit/tizen/20170928.090751
authorHaejeong Kim <backto.kim@samsung.com>
Wed, 27 Sep 2017 02:07:27 +0000 (11:07 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Wed, 27 Sep 2017 02:07:27 +0000 (11:07 +0900)
Change-Id: I98542505dc1c61283b18f18711ed02f88aeb8660

packaging/capi-media-thumbnail-util.spec
src/thumbnail_util.c

index 7e6e469..617caac 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-thumbnail-util
 Summary:    A media thumbnail util library in Tizen Native API
-Version: 0.1.10
+Version: 0.1.11
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index bee3c6b..5ed8607 100755 (executable)
@@ -28,6 +28,11 @@ int __thumbnail_util_replace_path(const char *path, char *replace_path)
        int ret = THUMBNAIL_UTIL_ERROR_NONE;
        char *old_path = NULL;
 
+       if (!STRING_VALID(path)) {
+               thumbnail_util_error("Invalid path");
+               return THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER;
+       }
+
        ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &old_path);
        if (ret != STORAGE_ERROR_NONE) {
                thumbnail_util_error("storage_get_directory failed");