X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=src%2Fextension_example%2Fparse_obj_list.c;fp=src%2Fextension_example%2Fparse_obj_list.c;h=aa743cfb545b9b8b6c9577ba168b2ef5c535918e;hb=b1d5b169352e57df3fc14c51ffad4b83f3e5613f;hp=21fc0196dc1217ec590f39af17f6fa0c49b3297c;hpb=11ba5b954689047f664873706964dc72878329f2;p=libcmdline.git diff --git a/src/extension_example/parse_obj_list.c b/src/extension_example/parse_obj_list.c index 21fc019..aa743cf 100644 --- a/src/extension_example/parse_obj_list.c +++ b/src/extension_example/parse_obj_list.c @@ -47,13 +47,17 @@ struct cmdline_token_ops token_obj_list_ops = { }; int -parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res) +parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res, + unsigned ressize) { struct token_obj_list *tk2 = (struct token_obj_list *)tk; struct token_obj_list_data *tkd = &tk2->obj_list_data; struct object *o; unsigned int token_len = 0; + if (res && ressize < sizeof(struct object *)) + return -1; + token_len = strlen(buf); SLIST_FOREACH(o, tkd->list, next) {