Changeset: 4930702c69ee for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4930702c69ee
Modified Files:
        clients/ChangeLog.Oct2010
        clients/src/mapilib/Mapi.mx
Branch: Oct2010
Log Message:

Use strcpy instead of strncat to work around what seemingly is a bug in 
Darwin's libc implementation of strncat.  Solves bug #2725


diffs (31 lines):

diff -r 557404a473ad -r 4930702c69ee clients/ChangeLog.Oct2010
--- a/clients/ChangeLog.Oct2010 Thu Nov 18 13:16:14 2010 +0100
+++ b/clients/ChangeLog.Oct2010 Fri Nov 19 11:06:34 2010 +0100
@@ -1,6 +1,10 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Fri Nov 19 2010 Fabian Groffen <[email protected]>
+- Workaround usage of strncat to solve mclient/mapilib aborts from
+  bug #2725
+
 * Fri Nov 12 2010 Sjoerd Mullender <[email protected]>
 - Fixed a corner case in the table display code.
 
diff -r 557404a473ad -r 4930702c69ee clients/src/mapilib/Mapi.mx
--- a/clients/src/mapilib/Mapi.mx       Thu Nov 18 13:16:14 2010 +0100
+++ b/clients/src/mapilib/Mapi.mx       Fri Nov 19 11:06:34 2010 +0100
@@ -2583,11 +2583,10 @@
                        if (mid->password[0] != '\1') {
                                unsigned char md[64];   /* should be 
SHA512_DIGEST_LENGTH */
                                size_t n = strlen(mid->password);
-                               char *key = alloca(n + 1);
+                               char *key = alloca(n);
                                int len;
 
-                               key[0] = '\0';
-                               strncat(key, mid->password, n);
+                               strncpy(key, mid->password, n);
 
                                if (strcmp(serverhash, "RIPEMD160") == 0) {
                                        RIPEMD160((unsigned char *) key, n, md);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to