index 4a1244f9a9b7ec30df5dcfee5257ea22d708fa78..b1d1d6d791687afc98e273db983b8f8727fcd424 100644 (file)
--- a/attr.c
+++ b/attr.c
* Attribute name cannot begin with '-' and must consist of
* characters from [-A-Za-z0-9_.].
*/
- if (*name == '-')
+ if (namelen <= 0 || *name == '-')
return -1;
while (namelen--) {
char ch = *name++;