Project

General

Profile

Bug #11092

libnsl: 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:
2019-05-31
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

NULL pointer errors:

    ../nss/parse.c: In function '_unescape':
    ../nss/parse.c:138:9: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      tmp[j] = NULL;
             ^

    ../rpc/clnt_simple.c: In function 'rpc_call':
    ../rpc/clnt_simple.c:118:39: error: comparison between pointer and integer [-Werror]
      if ((nettype == NULL) || (nettype[0] == NULL))
                                           ^~

    ../nss/getexecattr.c: In function '_doexeclist':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../nss/getexecattr.c:301:34: note: in expansion of macro 'NULL'
      (void) memset(argp->buf.buffer, NULL, argp->buf.buflen);
                                      ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../nss/getexecattr.c:34:
    /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);
                  ^~~~~~

    ../rpc/netname.c: In function 'host2netname':
    ../rpc/netname.c:309:18: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        domainname[0] = NULL;
                      ^

    ../rpc/rpc_generic.c: In function 'getnettype':
    ../rpc/rpc_generic.c:171:39: error: comparison between pointer and integer [-Werror]
      if ((nettype == NULL) || (nettype[0] == NULL))
                                           ^~
    ../rpc/rpc_generic.c: In function '__rpc_getconfip':
    ../rpc/rpc_generic.c:253:35: error: comparison between pointer and integer [-Werror]
      if ((netid == NULL) || (netid[0] == NULL))
                                       ^~

    ../rpc/clnt_generic.c: In function 'clnt_create_service_timed':
    ../rpc/clnt_generic.c:428:45: error: comparison between pointer and integer [-Werror]
        if (strcmp(nconf->nc_protofmly, NC_INET) == NULL)
                                                 ^~
    ../rpc/clnt_generic.c:432:51: error: comparison between pointer and integer [-Werror]
        else if (strcmp(nconf->nc_protofmly, NC_INET6) == NULL)
                                                       ^~
    ../netselect/netselect.c: In function 'setnetpath':
    ../netselect/netselect.c:466:12: error: comparison between pointer and integer [-Werror]
        if (*tp == NULL)
                ^~

    ../rpc/rpcb_clnt.c: In function 'got_entry':
    ../rpc/rpcb_clnt.c:547:52: error: comparison between pointer and integer [-Werror]
           (rmap->r_maddr != NULL) && (rmap->r_maddr[0] != NULL)) {
                                                        ^~
    ../rpc/rpcb_clnt.c: In function 'rpcb_gettime':
    ../rpc/rpcb_clnt.c:1229:33: error: comparison between pointer and integer [-Werror]
      if ((host == NULL) || (host[0] == NULL)) {
                                     ^~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/siginfo.h:34,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/signal.h:59,
                     from /code/illumos-gate/proto/root_i386/usr/include/thread.h:41,
                     from /code/illumos-gate/usr/src/lib/libnsl/include/mt.h:47,
                     from ../dial/dial.c:102:
    ../dial/interface.c: In function 'twrite':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 4 of 't_snd' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../dial/interface.c:189:43: note: in expansion of macro 'NULL'
       return ((ssize_t)t_snd(fd, buf, nbytes, NULL));
                                               ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/tiuser.h:36:0,
                     from ../dial/callers.c:455,
                     from ../dial/dial.c:118:
    /code/illumos-gate/proto/root_i386/usr/include/sys/tiuser.h:219:12: note: expected 'int' but argument is of type 'void *'
     extern int t_snd(int fildes, char *buf, unsigned nbytes, int flags);
                ^~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/siginfo.h:34,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/signal.h:59,
                     from /code/illumos-gate/proto/root_i386/usr/include/thread.h:41,
                     from /code/illumos-gate/usr/src/lib/libnsl/include/mt.h:47,
                     from ../dial/dial.c:102:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 4 of 't_snd' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../dial/interface.c:194:45: note: in expansion of macro 'NULL'
       if ((ret = t_snd(fd,  &buf[i], info.tsdu, NULL)) != info.tsdu)
                                                 ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/tiuser.h:36:0,
                     from ../dial/callers.c:455,
                     from ../dial/dial.c:118:
    /code/illumos-gate/proto/root_i386/usr/include/sys/tiuser.h:219:12: note: expected 'int' but argument is of type 'void *'
     extern int t_snd(int fildes, char *buf, unsigned nbytes, int flags);
                ^~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/siginfo.h:34,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/signal.h:59,
                     from /code/illumos-gate/proto/root_i386/usr/include/thread.h:41,
                     from /code/illumos-gate/usr/src/lib/libnsl/include/mt.h:47,
                     from ../dial/dial.c:102:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 4 of 't_snd' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../dial/interface.c:200:42: note: in expansion of macro 'NULL'
       if ((ret = t_snd(fd,  &buf[i], nbytes, NULL)) != nbytes)
                                              ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/tiuser.h:36:0,
                     from ../dial/callers.c:455,
                     from ../dial/dial.c:118:
    /code/illumos-gate/proto/root_i386/usr/include/sys/tiuser.h:219:12: note: expected 'int' but argument is of type 'void *'
     extern int t_snd(int fildes, char *buf, unsigned nbytes, int flags);
                ^~~~~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 4 months ago

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

git commit 344db6f401efe76f7e1d4f4c1a644ae593910219

commit  344db6f401efe76f7e1d4f4c1a644ae593910219
Author: Toomas Soome <tsoome@me.com>
Date:   2019-06-18T18:24:17.000Z

    11092 libnsl: NULL pointer errors
    Reviewed by: Norm Jacobs <naj@snapcon.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF