[Bug 1243] New: invalid dereference in pppd/pppd.c

rtems-bugs at rtems.org rtems-bugs at rtems.org
Tue May 8 11:34:44 CDT 2007


http://www.rtems.org/bugzilla/show_bug.cgi?id=1243

           Summary: invalid dereference in pppd/pppd.c
           Product: RTEMS
           Version: 4.7
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: major
          Priority: P3
         Component: pppd
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: ralf.corsepius at rtems.org


I am not sure, but I suspect the patch against cpukit/pppd/pppd.c below to
reveal an invalid de-reference in current code:

diff -u -r1.8 auth.c   
--- pppd/auth.c 27 Mar 2007 15:47:35 -0000      1.8
+++ pppd/auth.c 8 May 2007 16:02:42 -0000
@@ -968,7 +968,7 @@
        } else {   
            np = getnetbyname (ptr_word);
            if (np != NULL && np->n_addrtype == AF_INET) {
-               a = htonl (*(u_int32_t *)np->n_net);
+               a = htonl (np->n_net);
                if (ptr_mask == NULL) {
                    /* calculate appropriate mask for net */
                    ah = ntohl(a);

np is of type "struct netent" with n_net being defined in SUSv3 as follows:

uint32_t  n_net       The network number, in host byte order.

IMO, the conclusion must be: This dereference is wrong and should be removed
(i.e. the patch above be applied).


-- 
Configure bugmail: http://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.



More information about the rtems-bugs mailing list