[Bug nss/19835] New: __nss_getent calls function through a pointer of invalid type

fweimer at redhat dot com sourceware-bugzilla@sourceware.org
Thu Mar 17 15:17:00 GMT 2016


https://sourceware.org/bugzilla/show_bug.cgi?id=19835

            Bug ID: 19835
           Summary: __nss_getent calls function through a pointer of
                    invalid type
           Product: glibc
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nss
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
             Flags: security-

The situation is this:

typedef int (*getent_r_function) (void *, char *, size_t,
                                  void **result, int *);
…
__nss_getent (getent_r_function func, void **resbuf, char **buffer,
              size_t buflen, size_t *buffer_size, int *h_errnop)
…
         && func (resbuf, *buffer, *buffer_size, &result, h_errnop) == ERANGE
…

But __nss_getent is called with a pointer to (for example) __getgrent_r, which
is declated as:

extern int getgrent_r (struct group *__restrict __resultbuf,
                       char *__restrict __buffer, size_t __buflen,
                       struct group **__restrict __result);

So some of the function argument types do not match, and the code is not valid
C.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list