summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/chap.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-05-10 01:22:19 +0000
committerbrian <brian@FreeBSD.org>1997-05-10 01:22:19 +0000
commit82bac13560d095243e9988bfb770da73089749c1 (patch)
tree262cfd051516c08f29f6f133a950e9de9f2d42fd /usr.sbin/ppp/chap.c
parent1da867bda76bc701006945dfbc4733f550c91c2d (diff)
downloadFreeBSD-src-82bac13560d095243e9988bfb770da73089749c1.zip
FreeBSD-src-82bac13560d095243e9988bfb770da73089749c1.tar.gz
Tidy up the code - bounds checking, return
value checking etc. Submitted by: eivind
Diffstat (limited to 'usr.sbin/ppp/chap.c')
-rw-r--r--usr.sbin/ppp/chap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c
index f5bffb4..be677f56 100644
--- a/usr.sbin/ppp/chap.c
+++ b/usr.sbin/ppp/chap.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: chap.c,v 1.12 1997/03/17 14:47:55 ache Exp $
+ * $Id: chap.c,v 1.13 1997/03/24 16:01:42 ache Exp $
*
* TODO:
*/
@@ -153,6 +153,10 @@ struct mbuf *bp;
name = VarAuthName;
namelen = strlen(VarAuthName);
argp = malloc(1 + valsize + namelen + 16);
+ if (argp == NULL) {
+ ChapOutput(CHAP_FAILURE, chp->id, "Out of memory!", 14);
+ return;
+ }
digest = argp;
*digest++ = 16; /* value size */
ap = answer;
OpenPOWER on IntegriCloud