continue;
if (policy[i].type != BLOBMSG_TYPE_UNSPEC &&
+ policy[i].type != BLOBMSG_CAST_INT64 &&
blob_id(attr) != policy[i].type)
continue;
+ if (policy[i].type == BLOBMSG_CAST_INT64 &&
+ (blob_id(attr) != BLOBMSG_TYPE_INT64 &&
+ blob_id(attr) != BLOBMSG_TYPE_INT32 &&
+ blob_id(attr) != BLOBMSG_TYPE_INT16 &&
+ blob_id(attr) != BLOBMSG_TYPE_INT8))
+ continue;
+
if (blobmsg_namelen(hdr) != pslen[i])
continue;
if (len < 0)
return -1;
- sbuf = blobmsg_alloc_string_buffer(buf, name, len + 1);
+ sbuf = blobmsg_alloc_string_buffer(buf, name, len);
if (!sbuf)
return -1;
struct blob_attr *attr;
void *data_dest;
+ maxlen++;
attr = blobmsg_new(buf, BLOBMSG_TYPE_STRING, name, maxlen, &data_dest);
if (!attr)
return NULL;
{
struct blob_attr *attr = blob_next(buf->head);
int offset = attr_to_offset(buf, blob_next(buf->head)) + blob_pad_len(attr) - BLOB_COOKIE;
- int required = maxlen - (buf->buflen - offset);
+ int required = maxlen + 1 - (buf->buflen - offset);
if (required <= 0)
goto out;