apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1593681 - in /apr/apr/branches/1.6.x: ./ strings/apr_cpystrn.c
Date Sat, 10 May 2014 10:28:49 GMT
Author: sf
Date: Sat May 10 10:28:48 2014
New Revision: 1593681

URL: http://svn.apache.org/r1593681
Log:
Backport r1593680 from trunk:

  Fix NULL pointer dereference if out of mem
  in strdup() fallback function

  PR: 56385

Modified:
    apr/apr/branches/1.6.x/   (props changed)
    apr/apr/branches/1.6.x/strings/apr_cpystrn.c

Propchange: apr/apr/branches/1.6.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1593680

Modified: apr/apr/branches/1.6.x/strings/apr_cpystrn.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/strings/apr_cpystrn.c?rev=1593681&r1=1593680&r2=1593681&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/strings/apr_cpystrn.c (original)
+++ apr/apr/branches/1.6.x/strings/apr_cpystrn.c Sat May 10 10:28:48 2014
@@ -235,6 +235,8 @@ char *strdup(const char *str)
     size_t len = strlen(str) + 1;
 
     sdup = (char *) malloc(len);
+    if (sdup == NULL)
+        return NULL;
     memcpy(sdup, str, len);
 
     return sdup;



Mime
View raw message