NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/47613: different structure definition for struct ypmaplist in header files



>Number:         47613
>Category:       lib
>Synopsis:       different structure definition for struct ypmaplist in header 
>files
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 04 09:15:00 +0000 2013
>Originator:     Dr. W. Stukenbrock
>Release:        NetBSD 5.1.2
>Organization:
Dr. Nagler & Company GmbH
>Environment:
        
        
System: NetBSD test-s0 5.1.2 NetBSD 5.1.2 (NSW-WS) #3: Fri Dec 21 15:15:43 CET 
2012 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
        There are two different defintions of struct ypmaplist in the header
        files rpcsvc/yp.h and rpcsvc/yp_prot.h.
        The difference is that in yp_prot.h the map-name is inside of the 
structure
        as char [..] and in yp.h it is a char*.
        Now the function yp_malist() in rpcsvc/ypclnt.h returns this structure
        and in the headerfile it is just defined as an structure name.
        The correct definition is in rpcsvc/yp_prot.h and if the file
        rpcsvc/yp.h is included, the program will crash with SEGV.
        The problem may be related to the generation of the yp.h headerfile
        by rpcgen.
>How-To-Repeat:
        Try to use yp_maplist() and include rpcsvc/yp.h.
        The programm will SEGV when useing the maplist structure.
>Fix:
        Not realy shure. An easy way would be to eliminate the incorrect
        internal structure. An other way would be to fix yp_maplist to return
        the structure mentioned in rpcsvc/yp.h.
        Neverless the structure names should be different in rpcsvc/yp.h and 
rpcsvc/yp_prot.h
        to avoid such problems.
        Another problem is the fact, that for yp_maplist() there are allocated
        memroy portions that must be freed after usage by calling something
        like "xdr_free(xdr_ypresp_maplist, (void*)&ypml)".
        This requires the structure definition from yp_prot.h. Perhaps an 
additonal 
        function to free the result of yp_maplist() would make sence.
        remark: the yp_maplist() function is an extention to the yp-lib.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index