The branch, master has been updated via 977cf75 lib: Fix integer overflowed argument issue with strtoul() from edf77a1 ctdb-common: Reimplement pidfile_context_create() using pidfile_path_create()
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 977cf75166918d84c8362194a53a4d8d1b412964 Author: Andreas Schneider <a...@samba.org> Date: Thu Aug 3 10:52:59 2017 +0200 lib: Fix integer overflowed argument issue with strtoul() This fixes CID 1415704 Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> Autobuild-User(master): Volker Lendecke <v...@samba.org> Autobuild-Date(master): Thu Aug 3 15:06:34 CEST 2017 on sn-devel-144 ----------------------------------------------------------------------- Summary of changes: lib/uid_wrapper/uid_wrapper.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c index cb31c5e..8f41ed9 100644 --- a/lib/uid_wrapper/uid_wrapper.c +++ b/lib/uid_wrapper/uid_wrapper.c @@ -1029,7 +1029,21 @@ static void uwrap_init_env(struct uwrap_thread *id) unsetenv("UID_WRAPPER_INITIAL_GROUPS_COUNT"); } - if (ngroups > 0 && ngroups < GROUP_MAX_COUNT) { + env = getenv("UID_WRAPPER_INITIAL_GROUPS_COUNT"); + if (env != NULL && env[0] != '\0') { + char *endp = NULL; + long n; + + n = strtol(env, &endp, 10); + if (env == endp) { + ngroups = 0; + } else if (n > 0 && n < GROUP_MAX_COUNT) { + ngroups = (int)n; + } + unsetenv("UID_WRAPPER_INITIAL_GROUPS_COUNT"); + } + + if (ngroups > 0) { int i = 0; id->ngroups = 0; -- Samba Shared Repository