X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib%2Fsrc%2Fvlan.c;fp=lib%2Fsrc%2Fvlan.c;h=9c319ea758ed3c81e24999846ba9c9c6ccf26555;hb=2a2be3392d26d228c5d0499e334d7288a13f4f79;hp=962f2f2e0c5dbc280aa8396ca708c1f398447443;hpb=192160f19d388901b44ef62e9265a59282a06ad9;p=ngadmin diff --git a/lib/src/vlan.c b/lib/src/vlan.c index 962f2f2..9c319ea 100644 --- a/lib/src/vlan.c +++ b/lib/src/vlan.c @@ -36,6 +36,10 @@ int ngadmin_getVLANType (struct ngadmin *nga, int *t) goto end; } at = attr->first->data; + if (at->size != 1) { + ret = ERR_BADREPLY; + goto end; + } *t =(int)*(char*)at->data; end: @@ -460,6 +464,10 @@ int ngadmin_getAllPVID (struct ngadmin *nga, unsigned short *ports) for (ln = attr->first; ln != NULL; ln = ln->next) { at = ln->data; ap = at->data; + if (at->size == 0) { + ret = ERR_BADREPLY; + goto end; + } if (ap->port <= sa->ports) ports[ap->port - 1] = ap->vlan; }