Remove a null pointer reference

Submitted by: Brian Somers (brian@freebsd.org)
This commit is contained in:
Julian Elischer 1999-11-09 00:31:04 +00:00
parent 880dead128
commit 12f035e0fd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53042
3 changed files with 4 additions and 2 deletions

View File

@ -424,7 +424,7 @@ ng_decodeidname(const char *name)
/* Decode number */
val = strtoul(name + 1, &eptr, 16);
if (eptr - name != len - 1 || val == ULONG_MAX || val == 0)
return (0);
return ((ng_ID_t)0);
return (ng_ID_t)val;
}

View File

@ -291,6 +291,7 @@ AAA
neg->tags[i] = tp;
} else {
printf("pppoe: asked to add too many tags to packet\n");
neg->numtags--;
}
}
@ -1181,6 +1182,7 @@ AAA
uniqtag.data.pointer = sp;
init_tags(sp);
insert_tag(sp, &neg->ac_name.hdr); /* AC_NAME */
tag = get_tag(ph, PTT_HOST_UNIQ);
insert_tag(sp, tag); /* returned hostunique */
insert_tag(sp, &uniqtag.hdr); /* AC cookie */
tag = get_tag(ph, PTT_SRV_NAME);

View File

@ -94,7 +94,7 @@ struct ngpppoestat {
*
* When this structure is accepted by the NGM_PPPOE_WAIT command.
* If no service is given this is assumed to accept ALL PADI requests.
* This may at some time take a regexp exporession, but not yet.
* This may at some time take a regexp expression, but not yet.
* Matching PADI requests will be passed up the named hook.
*
*