X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Flib%2Fbcaps-v13.c;h=6a0a6dbaebb913f3492add951430f918b21f50a4;hb=38fe8b4a2dd28aebf52787c5b65cc79490fa53d3;hp=69181581cd8e7ab65f64f3a61d4c50369710208f;hpb=94f2186db8cb5331338ccd862ab698617d878d7c;p=util-vserver.git diff --git a/util-vserver/lib/bcaps-v13.c b/util-vserver/lib/bcaps-v13.c index 6918158..6a0a6db 100644 --- a/util-vserver/lib/bcaps-v13.c +++ b/util-vserver/lib/bcaps-v13.c @@ -26,6 +26,7 @@ #include #include +#include #include #ifndef CAP_QUOTACTL @@ -70,8 +71,9 @@ static struct Mapping_uint64 const VALUES[] = { inline static char const * removePrefix(char const *str, size_t *len) { - if (strncasecmp("cap_", str, 4)==0) { - if (len && *len) *len -= 4; + if ((len==0 || *len==0 || *len>4) && + strncasecmp("cap_", str, 4)==0) { + if (len && *len>4) *len -= 4; return str+4; } else