Fixed a false success return value with iso_aa_lookup_attr().

This commit is contained in:
Thomas Schmitt 2009-03-31 12:16:19 +02:00
parent 21de3e2087
commit ece52dc070
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
Implementation for encoding and decoding xattr and ACL. Implementation for encoding and decoding xattr and ACL.
See http://libburnia-project.org/wiki/AAIP See http://libburnia-project.org/wiki/AAIP
or doc/susp_aaip_1_0.txt or doc/susp_aaip_2_0.txt
test/aaip_0_2.h - Public declarations test/aaip_0_2.h - Public declarations

View File

@ -1458,7 +1458,7 @@ int iso_aa_lookup_attr(unsigned char *aa_string, char *name,
{ {
size_t num_attrs = 0, *value_lengths = NULL; size_t num_attrs = 0, *value_lengths = NULL;
char **names = NULL, **values = NULL; char **names = NULL, **values = NULL;
int i, ret = 0; int i, ret = 0, found = 0;
ret = iso_aa_get_attrs(aa_string, &num_attrs, &names, ret = iso_aa_get_attrs(aa_string, &num_attrs, &names,
&value_lengths, &values, 0); &value_lengths, &values, 0);
@ -1474,12 +1474,12 @@ int iso_aa_lookup_attr(unsigned char *aa_string, char *name,
if (*value_length > 0) if (*value_length > 0)
memcpy(*value, values[i], *value_length); memcpy(*value, values[i], *value_length);
(*value)[*value_length] = 0; (*value)[*value_length] = 0;
ret = 1; found = 1;
break; break;
} }
iso_aa_get_attrs(aa_string, &num_attrs, &names, iso_aa_get_attrs(aa_string, &num_attrs, &names,
&value_lengths, &values, 1 << 15); &value_lengths, &values, 1 << 15);
return ret; return found;
} }