Corrected some bugs with attribute list decoding

This commit is contained in:
Thomas Schmitt 2009-01-01 16:13:16 +00:00
parent aac9c23152
commit 598d994644
1 changed files with 5 additions and 2 deletions

View File

@ -1258,9 +1258,10 @@ int aaip_decode_attrs(struct aaip_state **handle, char aa_name[2],
{
int ret, was_non_aa= 0;
struct aaip_state *aaip;
size_t h_num, *h_lengths, i, new_mem;
size_t h_num, *h_lengths, i, new_mem, pair_consumed= 0;
char **h_names, **h_values;
*consumed= 0;
if(flag & (1 << 15)) {
if(*handle == NULL)
return(0);
@ -1327,10 +1328,11 @@ int aaip_decode_attrs(struct aaip_state **handle, char aa_name[2],
ret= aaip->list_pending_pair;
aaip->list_pending_pair= 0;
} else {
ret= aaip_decode_pair(aaip, data, num_data, consumed,
ret= aaip_decode_pair(aaip, data, num_data, &pair_consumed,
aaip->name_buf, aaip->name_buf_size, &aaip->name_buf_fill,
aaip->value_buf, aaip->value_buf_size, &aaip->value_buf_fill,
1);
*consumed+= pair_consumed;
}
if(ret == -2) { /* insufficient result_size */
if(aaip->first_is_name)
@ -1393,6 +1395,7 @@ int aaip_decode_attrs(struct aaip_state **handle, char aa_name[2],
aaip->list_num_attrs++;
aaip->name_buf_fill= aaip->value_buf_fill= 0;
ret= aaip->list_pending_pair;
aaip->list_pending_pair= 0;
if(ret == 2)