NetBSD Problem Report #47613

From Wolfgang.Stukenbrock@nagler-company.com  Mon Mar  4 09:11:37 2013
Return-Path: <Wolfgang.Stukenbrock@nagler-company.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 774F563C07C
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  4 Mar 2013 09:11:37 +0000 (UTC)
Message-Id: <20130304091105.F2F30123B93@test-s0.nagler-company.com>
Date: Mon,  4 Mar 2013 10:11:05 +0100 (CET)
From: Wolfgang.Stukenbrock@nagler-company.com
Reply-To: Wolfgang.Stukenbrock@nagler-company.com
To: gnats-bugs@gnats.NetBSD.org
Subject: different structure definition for struct ypmaplist in header files
X-Send-Pr-Version: 3.95

>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:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.