uci移植到嵌入式设备
uci show network出现如下错误
uci show: Parse error (config without name) at line 1, byte 0
问题分析
检查network配置文件格式没有问题,最后查看uci源码,发现如下代码导致
if (uci_increase_pos(pctx, strlen(pctx_cur_str(pctx)) + 1))
uci_parse_error(ctx, "config without name");
uci_increase_pos函数
static int uci_increase_pos(struct uci_parse_context *pctx, size_t add)
{
if (pctx->pos + add > pctx->buf_filled)
return -EINVAL;
pctx->pos += add;
return 0;
}
查看这段代码,发现是Check buffer size after strtok() patch合入
解决方案
移除uci-v2-2-4-file-Check-buffer-size-after-strtok.diffpatch,问题得