Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 268546

Summary: net-libs/libproxy-0.2.3: Poor programming practices
Product: Gentoo Linux Reporter: Arfrever Frehtes Taifersar Arahesis (RETIRED) <arfrever>
Component: New packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: VERIFIED FIXED    
Severity: normal Keywords: Inclusion
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
URL: http://code.google.com/p/libproxy/issues/detail?id=47
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: libproxy-0.2.3-fix-implicit-declaration.patch

Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-05-04 03:26:24 UTC
net-libs/libproxy-0.2.3 uses implicitly declared function strdup() which causes:

 * QA Notice: Package has poor programming practices which may compile
 *            fine but exhibit random runtime failures.
 * proxy.c:50: warning: implicit declaration of function ‘strdup’


From string.h:
#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Duplicate S, returning an identical malloc'd string.  */
extern char *strdup (__const char *__s)
     __THROW __attribute_malloc__ __nonnull ((1));
#endif


As you can see, strdup() returns 'char *', but compiler treats all implicitly declared functions as returning 'int'. It will cause segmentation fault on 64-bit architectures where sizeof(pointer) != sizeof(int).
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-05-04 03:28:06 UTC
Created attachment 190279 [details, diff]
libproxy-0.2.3-fix-implicit-declaration.patch
Comment 2 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-05-10 08:55:38 UTC
good to go.
Comment 3 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-05-14 21:30:49 UTC
commited without a bump. Please make sure this reaches upstream as well. Thanks for your report.
Comment 4 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-05-16 09:03:17 UTC
thanks.