X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-install.c;fp=src%2Fwgtpkg-install.c;h=7d0c3187e091bf999ccd45563b4787b9521c6060;hb=5b74cd6f2b5cdd82273759aa7d72150dfff58a2c;hp=264606a118e144202f8026fa68de8ce84bdb949b;hpb=628dc10767d95436538391534dc3c95f45fe9a3a;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c index 264606a..7d0c318 100644 --- a/src/wgtpkg-install.c +++ b/src/wgtpkg-install.c @@ -56,14 +56,19 @@ static int check_valid_string(const char *value, const char *name) return -1; pos = 0; c = value[pos]; - while(c) { + if (c == 0) { + ERROR("empty string forbidden in '%s' (temporary constraints)", name); + errno = EINVAL; + return -1; + } + do { if (!isalnum(c) && !strchr(".-_", c)) { ERROR("forbidden char %c in '%s' -> '%s' (temporary constraints)", c, name, value); errno = EINVAL; return -1; } c = value[++pos]; - } + } while(c); return 0; }