#49004 1.2.11 only -- coverity fixes
Closed: wontfix None Opened 7 years ago by nhosoi.

Compiler warnings
1.

1. 389-ds-base-1.2.11.15/ldap/servers/plugins/replication/cl5_api.c:0: scope_hint: In function 'trigger_cl_purging_thread'
2. 389-ds-base-1.2.11.15/ldap/servers/plugins/replication/cl5_api.c:3578: warning: dereferencing pointer 'iterator.302' does break strict-aliasing rules
3. 389-ds-base-1.2.11.15/ldap/servers/plugins/replication/cl5_api.c:3578: note: initialized from here
#  3576|        object_acquire (obj);
#  3577|        it->file = obj;
#  3578|->      *(CL5Iterator**)iterator = it;
#  3579|

2.

1. 389-ds-base-1.2.11.15/ldap/servers/plugins/pwdstorage/clear_pwd.c:0: scope_hint: In function 'clear_pw_cmp'
2. 389-ds-base-1.2.11.15/ldap/servers/plugins/pwdstorage/clear_pwd.c:58: warning: unused variable 'len'
#    56|   {
#    57|       int result = 0;
#    58|->     int len = 0;
#    59|       int len_user = strlen(userpwd);
#    60|       int len_dbp = strlen(dbpwd);

CLANG_WARNING

1. 389-ds-base-1.2.11.15/ldap/servers/slapd/ssl.c:1068:14: warning: Value stored to 'NSSVersionMax' during its initialization is never read
#     PRUint16 NSSVersionMax = enabledNSSVersions.max;
#              ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
4. 389-ds-base-1.2.11.15/ldap/servers/slapd/ssl.c:1068:14: note: Value stored to 'NSSVersionMax' during its initialization is never read
#     PRUint16 NSSVersionMax = enabledNSSVersions.max;
#              ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
#  1066|   #if !defined(NSS_TLS10) /* NSS_TLS11 or newer */
#  1067|       PRUint16 NSSVersionMin = SSL_LIBRARY_VERSION_TLS_1_0;
#  1068|->     PRUint16 NSSVersionMax = enabledNSSVersions.max;
#  1069|   #endif
#  1070|

BUild warnings
1.

Type pun (strict-aliasing) warning seen in i686 build log:
   4703  ldap/servers/plugins/replication/cl5_api.c: In function 'trigger_cl_purging_thread':
   4704  ldap/servers/plugins/replication/cl5_api.c:3578: warning: dereferencing pointer 'iterator.325' does break strict-aliasing rules

2.

Type pun (strict-aliasing) warning seen in x86_64 build log:
   4773  ldap/servers/plugins/replication/cl5_api.c: In function 'trigger_cl_purging_thread':
   4774  ldap/servers/plugins/replication/cl5_api.c:3578: warning: dereferencing pointer 'iterator.302' does break strict-aliasing rules

2.


Compiler warnings
{{{
1. warning: dereferencing pointer 'iterator.302' does break strict-aliasing rules
}}}
and
{{{
Build warnings 1 and 2
}}}
are pointing the same issue. That is a bug in gcc-4 on RHEL6.
Reasoning: the same code is found in 389-ds-base.1.3.5 branch but gcc-5 on RHEL7 does not report the warning.

CLANG_WARNING is false positive. NSSVersionMax is read in the same function slapd_ssl_init2, again. The read happens in the next #if !defined(NSS_TLS10) section. Most likely, coverity failed to detect it(?)

Thus, the real issue is just "Compiler warnings 2"

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.2.11.33

7 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2063

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

3 years ago

Login to comment on this ticket.

Metadata