Project

General

Profile

Bug #11351

iscsiadm: NULL pointer errors

Added by Toomas Soome about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with NULL pointer:

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdlib_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdlib.h:37,
                     from iscsiadm_main.c:25:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    iscsiadm_main.c:354:18: note: in expansion of macro 'NULL'
      {0, 0, 0, 0, 0, NULL}
                      ^~~~
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: note: (near initialization for 'objectRules[7].opCmd.multOpCmd')
     #define NULL ((void *)0)
                  ^
    iscsiadm_main.c:354:18: note: in expansion of macro 'NULL'
      {0, 0, 0, 0, 0, NULL}
                      ^~~~
    iscsiadm_main.c: In function 'getTargetAddress':
    iscsiadm_main.c:655:12: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        *colPos = NULL;
                ^
    iscsiadm_main.c:658:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *colPos = NULL;
               ^
    iscsiadm_main.c:675:15: error: comparison between pointer and integer [-Werror]
       if (*colPos == NULL) {
                   ^~
    iscsiadm_main.c: In function 'getSecret':
    iscsiadm_main.c:1523:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *secret = NULL;
               ^
    iscsiadm_main.c:1531:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *secret = NULL;
               ^
    iscsiadm_main.c:1539:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *secret = NULL;
               ^
    iscsiadm_main.c:1550:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *secret = NULL;
               ^
    iscsiadm_main.c:1557:11: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *secret = NULL;
               ^
    iscsiadm_main.c: In function 'modifyNodeAuthMethod':
    iscsiadm_main.c:3455:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *commaPos = NULL;
                 ^
    iscsiadm_main.c: In function 'modifyTargetAuthMethod':
    iscsiadm_main.c:3510:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *commaPos = NULL;
                 ^
    iscsiadm_main.c: In function 'removeTargetParam':
    iscsiadm_main.c:4701:14: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        *commaPos = NULL;
                  ^
    iscsiadm_main.c: In function 'parseAddress':
    iscsiadm_main.c:5065:22: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *close_bracket_pos = NULL;
                          ^
    iscsiadm_main.c:5073:27: error: comparison between pointer and integer [-Werror]
        if (*close_bracket_pos != NULL) {
                               ^~
    iscsiadm_main.c:5111:17: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
        *colon_pos = (char)NULL;
                     ^
    iscsiadm_main.c:5117:19: error: comparison between pointer and integer [-Werror]
        if (*colon_pos != NULL) {
                       ^~
    iscsiadm_main.c: In function 'iSCSINameStringProfileCheck':
    iscsiadm_main.c:5171:27: error: comparison between pointer and integer [-Werror]
      for (tmp = mb_name; *tmp != NULL; tmp++) {
                               ^~
    iscsiadm_main.c: In function 'parseTarget':
    iscsiadm_main.c:5353:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *commaPos = NULL;
                 ^
    iscsiadm_main.c:5363:15: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        *commaPos2 = NULL;
                   ^
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 12 months ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit 33c72b7598992897b94815b1f47b7b8077e53808

commit  33c72b7598992897b94815b1f47b7b8077e53808
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-12T06:19:00.000Z

    11351 iscsiadm: NULL pointer errors
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF