Bug 56385 - strdup possible null pointer dereference
Summary: strdup possible null pointer dereference
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC other
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-10 20:57 UTC by Max
Modified: 2014-05-10 10:29 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max 2014-04-10 20:57:22 UTC
Unchecked Return Value to memcpy() on NOPOSIX systems

httpd-2.2.27/srclib/apr/strings/apr_cpystrn.c

#if !APR_HAVE_STRDUP
char *strdup(const char *str)
{
    char *sdup;
    size_t len = strlen(str) + 1;
 
    sdup = (char *) malloc(len);
    memcpy(sdup, str, len);
 
    return sdup;
}
#endif


BR,
Maksymilian
cifrex.org
Comment 1 Christophe JAILLET 2014-04-20 09:19:32 UTC
Reassigning to APR
Comment 2 Stefan Fritsch 2014-05-10 10:29:42 UTC
trunk r1593680
1.6 r1593681