diff options
Diffstat (limited to 'src/wgtpkg-install.c')
-rw-r--r-- | src/wgtpkg-install.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; } |