Project

General

Profile

Bug #11170

print: NULL pointer errors

Added by Toomas Soome 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

NULL pointer errors:

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/lpd-misc.c:31:
    ../common/lpd-misc.c: In function 'recvfd':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/lpd-misc.c:86:19: note: in expansion of macro 'NULL'
      memset(&recv_fd, NULL, sizeof (recv_fd));
                       ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/lpd-misc.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~

    ../common/common.c: In function 'add_supported_locales':
    ../common/common.c:253:43: error: comparison between pointer and integer [-Werror]
        for (i = 0; ((passed == 1) && (name[i] != NULL)); i++)
                                               ^~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/lpd-job.c:32:
    ../common/lpd-job.c: In function 'lpd_add_svr4_attributes':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/lpd-job.c:387:14: note: in expansion of macro 'NULL'
      memset(tmp, NULL, sizeof (tmp));
                  ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/lpd-job.c:40:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/attribute.c:32:
    ../common/attribute.c: In function '_process_value':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: incompatible types when initializing type 'enum <anonymous>' using type 'void *'
     #define NULL ((void *)0)
                  ^
    ../common/attribute.c:651:3: note: in expansion of macro 'NULL'
       NULL
       ^~~~

    ../common/ns_cmn_printer.c: In function 'ns_printer_name_list':
    ../common/ns_cmn_printer.c:154:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      buf[strlen(buf) - 1] = (char)NULL;
                             ^
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/list.c:30:
    ../common/list.c: In function 'list_append':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/list.c:61:23: note: in expansion of macro 'NULL'
       (void) memset(list, NULL, (_list_increment * sizeof (void *)));
                           ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/strings.h:36,
                     from ../common/list.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/list.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/list.c:75:28: note: in expansion of macro 'NULL'
        (void) memset(new_list, NULL,
                                ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/strings.h:36,
                     from ../common/list.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/list.c:30:
    ../common/list.c: In function 'list_concatenate':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/list.c:149:23: note: in expansion of macro 'NULL'
       (void) memset(list, NULL, (new_size * sizeof (void *)));
                           ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/strings.h:36,
                     from ../common/list.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    ../common/nss_convert.c: In function 'strncat_escaped':
    ../common/nss_convert.c:56:13: error: comparison between pointer and integer [-Werror]
      while ((*t != NULL) && (len > 0))
                 ^~
    ../common/nss_convert.c:62:13: error: comparison between pointer and integer [-Werror]
      while ((*s != NULL) && (len > 0)) {
                 ^~
    ../common/nss_convert.c:67:5: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *t = NULL;
         ^
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    ../common/nss_convert.c: In function '_cvt_printer_to_entry':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:80:21: note: in expansion of macro 'NULL'
      (void) memset(buf, NULL, buflen);
                         ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:86:22: note: in expansion of macro 'NULL'
       (void) memset(buf, NULL, buflen);
                          ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:102:22: note: in expansion of macro 'NULL'
       (void) memset(buf, NULL, buflen);
                          ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:124:22: note: in expansion of macro 'NULL'
       (void) memset(buf, NULL, buflen);
                          ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:130:22: note: in expansion of macro 'NULL'
       (void) memset(buf, NULL, buflen);
                          ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    ../common/nss_convert.c: In function '_cvt_nss_entry_to_printer':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:152:21: note: in expansion of macro 'NULL'
      (void) memset(buf, NULL, sizeof (buf));
                         ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    ../common/nss_convert.c:153:23: error: comparison between pointer and integer [-Werror]
      for (cp = entry; *cp != NULL; cp++) {
                           ^~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:169:23: note: in expansion of macro 'NULL'
        (void) memset(buf, NULL, sizeof (buf));
                           ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:176:24: note: in expansion of macro 'NULL'
         (void) memset(buf, NULL, sizeof (buf));
                            ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/nss_convert.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/nss_convert.c:189:24: note: in expansion of macro 'NULL'
         (void) memset(buf, NULL, sizeof (buf));
                            ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../common/nss_convert.c:37:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    ../common/ns_bsd_addr.c: In function 'string_to_value':
    ../common/ns_bsd_addr.c:202:54: error: comparison between pointer and integer [-Werror]
      if ((key != NULL) && (string != NULL) && (string[0] != NULL)) {
                                                          ^~
    ../common/ns_bsd_addr.c: In function 'posix_name':
    ../common/ns_bsd_addr.c:282:14: error: comparison between pointer and integer [-Werror]
       if (buf[0] != NULL) {
                  ^~

    ../common/nss_write.c: In function 'freadline':
    ../common/nss_write.c:67:8: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
         *s = NULL;
            ^
    ../common/nss_write.c: In function 'nis_put_printer':
    ../common/nss_write.c:276:8: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *tmp = NULL; /* strip the .byname */
            ^
    cc1: all warnings being treated as errors


Related issues

Related to illumos gate - Bug #11269: libipp-listener: leftover debug/test construct with FORCE_LPSCHED_URIClosed

Actions
Related to illumos gate - Bug #11270: libipp-listener: strtok() can return NULL and we do leak open fileClosed

Actions
Related to illumos gate - Bug #11271: libprint: memset after calloc and possible NULL pointer dereferenceClosed

Actions

History

#1

Updated by Toomas Soome 4 months ago

  • Related to Bug #11269: libipp-listener: leftover debug/test construct with FORCE_LPSCHED_URI added
#2

Updated by Toomas Soome 4 months ago

  • Related to Bug #11270: libipp-listener: strtok() can return NULL and we do leak open file added
#3

Updated by Toomas Soome 4 months ago

  • Related to Bug #11271: libprint: memset after calloc and possible NULL pointer dereference added
#4

Updated by Electric Monk 4 months ago

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

git commit f4593de73bc951089c91679a1104a589e85475d4

commit  f4593de73bc951089c91679a1104a589e85475d4
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-01T18:33:31.000Z

    11170 print: NULL pointer errors
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Reviewed by: Norm Jacobs <naj@snapcon.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF