summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Riondato <matteo@FreeBSD.org>2008-02-04 07:56:36 +0000
committerMatteo Riondato <matteo@FreeBSD.org>2008-02-04 07:56:36 +0000
commitc75cd2cb752cdda249dfa228adfc0565c80f3603 (patch)
tree078b1c1eb80b51085c6ca311791d0ed08fa2e3d8
parentb42024b241a3e1109c69096110ee984e37b5c232 (diff)
Notes
-rw-r--r--lib/librpcsvc/Makefile2
-rw-r--r--lib/librpcsvc/xcrypt.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/librpcsvc/Makefile b/lib/librpcsvc/Makefile
index 3939a6af24f0..c9674cb068e1 100644
--- a/lib/librpcsvc/Makefile
+++ b/lib/librpcsvc/Makefile
@@ -29,6 +29,8 @@ SRCS+= ${GENSRCS} ${OTHERSRCS} ${SECRPCSRCS}
CLEANFILES+= ${GENSRCS}
+WARNS?= 2
+
.include <bsd.lib.mk>
.SUFFIXES: .x _xdr.c
diff --git a/lib/librpcsvc/xcrypt.c b/lib/librpcsvc/xcrypt.c
index ed6cbefcc14e..7a310d3d10f2 100644
--- a/lib/librpcsvc/xcrypt.c
+++ b/lib/librpcsvc/xcrypt.c
@@ -67,7 +67,9 @@ xencrypt(secret, passwd)
int len;
len = strlen(secret) / 2;
- buf = malloc((unsigned)len);
+ if ((buf = malloc((unsigned)len)) == NULL) {
+ return(0);
+ }
hex2bin(len, secret, buf);
passwd2des(passwd, key);
@@ -100,7 +102,9 @@ xdecrypt(secret, passwd)
int len;
len = strlen(secret) / 2;
- buf = malloc((unsigned)len);
+ if ((buf = malloc((unsigned)len)) == NULL) {
+ return(0);
+ }
hex2bin(len, secret, buf);
passwd2des(passwd, key);