Explorar o código

fix wrong buffer allocation

Felix Fietkau %!s(int64=16) %!d(string=hai) anos
pai
achega
236f7468c5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      list.c

+ 1 - 1
list.c

@@ -469,7 +469,7 @@ int uci_add_element_list(struct uci_context *ctx, struct uci_option *o, const ch
 	if (!internal && p->has_history)
 		uci_add_history(ctx, &p->history, UCI_CMD_LIST_ADD, s->e.name, o->e.name, value);
 
-	e = uci_alloc_generic(ctx, UCI_TYPE_ITEM, value, 0);
+	e = uci_alloc_generic(ctx, UCI_TYPE_ITEM, value, sizeof(struct uci_option));
 	uci_list_add(&o->v.list, &e->list);
 
 	return 0;