From: Günther Deschner Date: Mon, 3 May 2021 19:27:58 +0000 (+0200) Subject: Fix gcc11 compiler issue "-Werror=stringop-overflow=" X-Git-Tag: tevent-0.11.0~936 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17ae9974f36ce8929f0c50c357dd4f88fbf37d7c;p=thirdparty%2Fsamba.git Fix gcc11 compiler issue "-Werror=stringop-overflow=" BUG: https://bugzilla.samba.org/show_bug.cgi?id=14699 [3548/3991] Compiling source3/winbindd/winbindd_pam.c ../../source3/winbindd/winbindd_pam.c: In function ‘winbindd_dual_pam_auth_cached’: ../../source3/winbindd/winbindd_pam.c:1069:18: error: ‘winbindd_get_creds’ accessing 128 bytes in a region of size 8 [-Werror=stringop-overflow=] 1069 | result = winbindd_get_creds(domain, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ 1070 | state->mem_ctx, | ~~~~~~~~~~~~~~~ 1071 | &sid, | ~~~~~ 1072 | &my_info3, | ~~~~~~~~~~ 1073 | &cached_nt_pass, | ~~~~~~~~~~~~~~~~ 1074 | &cached_salt); | ~~~~~~~~~~~~~ ../../source3/winbindd/winbindd_pam.c:1069:18: note: referencing argument 5 of type ‘const uint8_t **’ {aka ‘const unsigned char **’} ../../source3/winbindd/winbindd_pam.c:1069:18: error: ‘winbindd_get_creds’ accessing 128 bytes in a region of size 8 [-Werror=stringop-overflow=] ../../source3/winbindd/winbindd_pam.c:1069:18: note: referencing argument 6 of type ‘const uint8_t **’ {aka ‘const unsigned char **’} In file included from ../../source3/winbindd/winbindd.h:359, from ../../source3/winbindd/winbindd_pam.c:26: ../../source3/winbindd/winbindd_proto.h:251:10: note: in a call to function ‘winbindd_get_creds’ 251 | NTSTATUS winbindd_get_creds(struct winbindd_domain *domain, | ^~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Guenther Signed-off-by: Guenther Deschner Reviewed-by: Andreas Schneider --- diff --git a/source3/winbindd/winbindd_creds.c b/source3/winbindd/winbindd_creds.c index 2d7aacf36a9..97262bbf87b 100644 --- a/source3/winbindd/winbindd_creds.c +++ b/source3/winbindd/winbindd_creds.c @@ -33,8 +33,8 @@ NTSTATUS winbindd_get_creds(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const struct dom_sid *sid, struct netr_SamInfo3 **info3, - const uint8_t *cached_nt_pass[NT_HASH_LEN], - const uint8_t *cred_salt[NT_HASH_LEN]) + const uint8_t **cached_nt_pass, + const uint8_t **cred_salt) { struct netr_SamInfo3 *info; NTSTATUS status; diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 04edf3489bb..fec5d691dd8 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -252,8 +252,8 @@ NTSTATUS winbindd_get_creds(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const struct dom_sid *sid, struct netr_SamInfo3 **info3, - const uint8_t *cached_nt_pass[NT_HASH_LEN], - const uint8_t *cred_salt[NT_HASH_LEN]); + const uint8_t **cached_nt_pass, + const uint8_t **cred_salt); NTSTATUS winbindd_store_creds(struct winbindd_domain *domain, const char *user, const char *pass,