summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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 3939a6a..c9674cb 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 ed6cbef..7a310d3 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);
OpenPOWER on IntegriCloud