Project

General

Profile

Actions

tickets #116194

open

libgsasl: use of possibly-NULL '*output' where non-null expected

Added by AdaLovelace over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Good First Issues
Target version:
-
Start date:
2022-09-02
Due date:
% Done:

0%

Estimated time:

Description

That is a s390x specific bugfix for the package libgsasl.
[ 316s] client.c: In function 'gsasl_login_client_step':
[ 316s] client.c:88:21: error: use of possibly-NULL '*output' where non-null expected [CWE-690] [-Werror=analyzer-possible-null-argument]
[ 316s] 88 | *output_len = strlen (*output);
[ 316s] | ~~~~~~~~~~~~~~~
[ 316s] '_gsasl_login_client_step': events 1-6
[ 316s] |
[ 316s] | 68 | switch (state->step)
[ 316s] | | ~~~~~
[ 316s] | | |
[ 316s] | | (1) following 'case 1:' branch...
[ 316s] |......
[ 316s] | 82 | case 1:
[ 316s] | | ~~~~
[ 316s] | | |
[ 316s] | | (2) ...to here
[ 316s] | 83 | p = gsasl_property_get (sctx, GSASL_PASSWORD);
[ 316s] | 84 | if (!p)
[ 316s] | | ~
[ 316s] | | |
[ 316s] | | (3) following 'false' branch (when 'p' is non-NULL)...
[ 316s] |......
[ 316s] | 87 | *output = strdup (p);
[ 316s] | | ~ ~~~~~~~~~~
[ 316s] | | | |
[ 316s] | | | (5) this call could return NULL
[ 316s] | | (4) ...to here
[ 316s] | 88 | *output_len = strlen (*output);
[ 316s] | | ~~~~~~~~~~~~~~~~
[ 316s] | | |
[ 316s] | | (6) argument 1 ('strdup(p)') from (5) could be NULL where non-null expected
[ 316s] |
[ 316s] In file included from ./../gl/string.h:41,
[ 316s] from client.c:31:
[ 316s] /usr/include/string.h:407:15: note: argument 1 of 'strlen' must be non-null
[ 316s] 407 | extern size_t strlen (const char *
_s)
[ 316s] | ~~~~~
[ 316s] cc1: all warnings being treated as errors
[ 316s] make[2]: *** [Makefile:1561: client.lo] Error 1

log: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:zSystems/libgsasl/standard/s390x

1) Branch https://build.opensuse.org/package/show/devel:libraries:c_c++/libgsasl
2) "osc co" of your home directory
3) Create patch for fixing the non-null error
4) Build it on the mainframe
5) "osc add" of the patch
6) "osc commit"

No data to display

Actions

Also available in: Atom PDF