[110985] trunk/base/src/pextlib1.0/strsed.c

toby at macports.org toby at macports.org
Thu Sep 12 15:35:16 PDT 2013


Revision: 110985
          https://trac.macports.org/changeset/110985
Author:   toby at macports.org
Date:     2013-09-12 15:35:16 -0700 (Thu, 12 Sep 2013)
Log Message:
-----------
fix overlap check aborts

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/strsed.c

Modified: trunk/base/src/pextlib1.0/strsed.c
===================================================================
--- trunk/base/src/pextlib1.0/strsed.c	2013-09-12 22:12:08 UTC (rev 110984)
+++ trunk/base/src/pextlib1.0/strsed.c	2013-09-12 22:35:16 UTC (rev 110985)
@@ -662,7 +662,7 @@
 
 	    if (need > 0){
 		more_space(need);
-		strncpy(new_str + new_pos, str, need);
+		memmove(new_str + new_pos, str, need);
 		new_pos += need;
 	    }
 
@@ -756,7 +756,7 @@
      *
      */
     more_space(str_len);
-    (void) strcpy(new_str + new_pos, str);
+    (void) memmove(new_str + new_pos, str, strlen(str) + 1);
     RETURN(new_str);
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130912/8f6d6995/attachment.html>


More information about the macports-changes mailing list