git.samba.org
/
slow
/
pam_wrapper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14adde1
)
pypamtest: Add sanity checks in new_conv_list()
author
Andreas Schneider
<asn@samba.org>
Thu, 6 Apr 2017 07:13:40 +0000
(09:13 +0200)
committer
Andreas Schneider
<asn@samba.org>
Thu, 6 Apr 2017 07:20:23 +0000
(09:20 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
src/python/pypamtest.c
patch
|
blob
|
history
diff --git
a/src/python/pypamtest.c
b/src/python/pypamtest.c
index 2a2f7c48679c622449c7cce2f9dcfa46b224056c..585f27d0f110fbbe6c79af356eab3178c209ba7c 100644
(file)
--- a/
src/python/pypamtest.c
+++ b/
src/python/pypamtest.c
@@
-133,10
+133,18
@@
static void free_string_list(char **list)
PyMem_Free(list);
}
-static char **new_conv_list(const
in
t list_size)
+static char **new_conv_list(const
size_
t list_size)
{
char **list;
- int i;
+ size_t i;
+
+ if (list_size == 0) {
+ return NULL;
+ }
+
+ if (list_size + 1 < list_size) {
+ return NULL;
+ }
list = PyMem_New(char *, list_size + 1);
if (list == NULL) {