Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 268546 - net-libs/libproxy-0.2.3: Poor programming practices
Summary: net-libs/libproxy-0.2.3: Poor programming practices
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: http://code.google.com/p/libproxy/iss...
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2009-05-04 03:26 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2009-05-16 09:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
libproxy-0.2.3-fix-implicit-declaration.patch (libproxy-0.2.3-fix-implicit-declaration.patch,206 bytes, patch)
2009-05-04 03:28 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 gentoo-dev 2009-05-10 08:55:38 UTC
good to go.
Comment 3 Gilles Dartiguelongue 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 gentoo-dev 2009-05-16 09:03:17 UTC
thanks.