git.samba.org
/
nss_wrapper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f30d31
)
nwrap: Check paramters and make sure return values are zeored
author
Andreas Schneider
<asn@samba.org>
Thu, 19 Mar 2020 08:16:24 +0000
(09:16 +0100)
committer
Andreas Schneider
<asn@samba.org>
Thu, 19 Mar 2020 08:49:39 +0000
(09:49 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
src/nss_wrapper.c
patch
|
blob
|
history
diff --git
a/src/nss_wrapper.c
b/src/nss_wrapper.c
index 5d3a01c5ce3f826d2b4a37d4ae95eea00f40fe9f..15bd99f4e86c08be723f67a75919f3853fdf9510 100644
(file)
--- a/
src/nss_wrapper.c
+++ b/
src/nss_wrapper.c
@@
-3727,6
+3727,13
@@
static int nwrap_files_gethostbyname2_r(struct nwrap_backend *b,
(void) b; /* unused */
(void) af; /* unused */
+ if (name == NULL || hedst == NULL || buf == NULL || buflen == 0) {
+ errno = EINVAL;
+ return -1;
+ }
+ *hedstp = NULL;
+ buf[0] = '\0';
+
addr_list = calloc(1, sizeof(struct nwrap_vector));
if (addr_list == NULL) {
NWRAP_LOG(NWRAP_LOG_ERROR,