Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15638 closed defect (fixed)

code review of libubox

Reported by: ljf10000 Owned by: developers
Priority: low Milestone: Barrier Breaker 14.07
Component: base system Version: Attitude Adjustment 12.09
Keywords: Cc:

Description

int
blob_parse(struct blob_attr *attr, struct blob_attr data, const struct blob_attr_info *info, int max)
{

struct blob_attr *pos;
int found = 0;
int rem;

memset(data, 0, sizeof(struct blob_attr *) * max);
blob_for_each_attr(pos, attr, rem) {

int id = blob_id(pos);
int len = blob_len(pos);

if (id >= max)

continue;

if (info) {

int type = info[id].type;

if (type < BLOB_ATTR_LAST) {

if (!blob_check_type(blob_data(pos), len, type))

continue;

}

if (info[id].minlen && len < info[id].minlen)

continue;

if (info[id].maxlen && len > info[id].maxlen)

continue;

if (info[id].validate && !info[id].validate(&info[id], attr))

/* here, should use pos, not use attr */

continue;

}

if (!data[id])

found++;

data[id] = pos;

}
return found;

}

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fix committed to libubox.git in ef918710c02166c289442bd0a8b548da802dd36b

thanks

comment:2 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.