X-Git-Url: https://git.sur5r.net/?p=ngadmin;a=blobdiff_plain;f=lib%2Fsrc%2Fnetwork.c;h=3f3126bc304301362c0fe2ec1aea127068e1ec0e;hp=8f26fc921a010e71dbeddce811b00d2c52fcfd44;hb=2a2be3392d26d228c5d0499e334d7288a13f4f79;hpb=192160f19d388901b44ef62e9265a59282a06ad9 diff --git a/lib/src/network.c b/lib/src/network.c index 8f26fc9..3f3126b 100644 --- a/lib/src/network.c +++ b/lib/src/network.c @@ -314,7 +314,7 @@ end: } -void extractSwitchAttributes (struct swi_attr *sa, const List *l) +int extractSwitchAttributes (struct swi_attr *sa, const List *l) { const ListNode *ln; const struct attr *at; @@ -325,6 +325,8 @@ void extractSwitchAttributes (struct swi_attr *sa, const List *l) for (ln = l->first; ln != NULL; ln = ln->next) { at = ln->data; + if (at->size == 0) + return -EMSGSIZE; switch (at->attr) { @@ -374,9 +376,12 @@ void extractSwitchAttributes (struct swi_attr *sa, const List *l) break; case ATTR_END: - return; + return 0; } } + + + return 0; }