https://bugs.openldap.org/show_bug.cgi?id=9899
Issue ID: 9899 Summary: "cyrus.c" uses non-portable GNU extension for void pointer arithmetics and fails on HP-UX aCC Product: OpenLDAP Version: 2.6.3 Hardware: All OS: Other Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: libraries Assignee: bugs@openldap.org Reporter: michael.osipov@siemens.com Target Milestone: ---
On HP-UX with cc: HP C/aC++ B3910B A.06.29 [Oct 18 2016] tells me libtool: compile: /opt/aCC/bin/aCC -Ae -g -I../../include -I../../include -I/opt/ports/include -DLDAP_LIBRARY -c cyrus.c -DPIC -o .libs/cyrus.o "cyrus.c", line 420: error #3143: arithmetic on pointer to void or function type memcpy( cb_data + plen, cbv.bv_val, cbv.bv_len ); ^
1 error detected in the compilation of "cyrus.c". gmake[2]: *** [Makefile:434: cyrus.lo] Error 1
void pointer arithmetics is not valid/undefined and just a GNU extension supported by GCC or clang. I was able to reproduce this on FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303): osipovmi@deblndw011x:~/var/Projekte/openldap-2.6.3/libraries/libldap $ cc -std=c17 -I../../include -I../../include -I/usr/local/include -DLDAP_LIBRARY -c cyrus.c -o cyrus.o -pedantic -Werror cyrus.c:420:18: error: arithmetic on a pointer to void is a GNU extension [-Werror,-Wpointer-arith] memcpy( cb_data + plen, cbv.bv_val, cbv.bv_len ); ~~~~~~~ ^ 1 error generated.
I am not a daily C hacker, but I guess cb_data needs to be typed to "unsigned char" just like data from sasl_channel_binding_t (https://github.com/cyrusimap/cyrus-sasl/blob/cb549ef71c5bb646fe583697ebdcaba...).
Or at least a malloc with an "unsigned char", save the pointer start address, copy the prefix, increment by prefix length, copy the channel binding value and then assign the pointer start address to the output struct.
I will unset SASL_CHANNEL_BINDING for now since it is not required in your AD environment when SASL GSSAPI with minssf=1 is set.
https://bugs.openldap.org/show_bug.cgi?id=9899
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |IN_PROGRESS Ever confirmed|0 |1
--- Comment #1 from Howard Chu hyc@openldap.org --- Fixed in https://git.openldap.org/openldap/openldap/-/merge_requests/555
https://bugs.openldap.org/show_bug.cgi?id=9899
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |hyc@openldap.org
https://bugs.openldap.org/show_bug.cgi?id=9899
--- Comment #2 from michael.osipov@siemens.com --- (In reply to Howard Chu from comment #1)
Fixed in https://git.openldap.org/openldap/openldap/-/merge_requests/555
Thanks a million! Here is a followup with LLVM: https://bugs.openldap.org/show_bug.cgi?id=9901
https://bugs.openldap.org/show_bug.cgi?id=9899
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs_review | Target Milestone|--- |2.5.14
https://bugs.openldap.org/show_bug.cgi?id=9899
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |TEST
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- HEAD:
• 6c9eea73 by Howard Chu at 2022-08-22T16:44:05+00:00 ITS#9899 libldap: fix non-std syntax in cyrus.c
RE26:
• 9a67eb49 by Howard Chu at 2022-08-24T18:18:26+00:00 ITS#9899 libldap: fix non-std syntax in cyrus.c
RE25:
• bdb0e399 by Howard Chu at 2022-08-24T18:20:21+00:00 ITS#9899 libldap: fix non-std syntax in cyrus.c
https://bugs.openldap.org/show_bug.cgi?id=9899
--- Comment #4 from Quanah Gibson-Mount quanah@openldap.org --- head:
• e85a6246 by Howard Chu at 2022-10-26T16:33:30+01:00 ITS#9899 fix use of non-standard u_char/u_int types
RE26:
• a6cb0049 by Howard Chu at 2022-11-01T16:57:40+00:00 ITS#9899 fix use of non-standard u_char/u_int types
RE25:
• d74b57c1 by Howard Chu at 2022-11-01T16:58:58+00:00 ITS#9899 fix use of non-standard u_char/u_int types
https://bugs.openldap.org/show_bug.cgi?id=9899
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED Resolution|TEST |FIXED