| 1 |
This corrupted the path for me before, so it couldn't find the file. Presumably since the glibc change to copy stuff backwards.
|
| 2 |
|
| 3 |
diff -pudr wmbiff-0.4.27/wmbiff/mboxClient.c wmbiff-0.4.27-mik/wmbiff/mboxClient.c
|
| 4 |
--- wmbiff-0.4.27/wmbiff/mboxClient.c 2004-03-28 01:28:58.000000000 +0100
|
| 5 |
+++ wmbiff-0.4.27-mik/wmbiff/mboxClient.c 2011-09-16 09:54:22.834144487 +0200
|
| 6 |
@@ -149,7 +149,10 @@ int mboxCreate(Pop3 pc, const char *str)
|
| 7 |
DM(pc, DEBUG_ERROR, "mbox '%s' is too long.\n", str + 5);
|
| 8 |
memset(pc->path, 0, BUF_BIG);
|
| 9 |
} else {
|
| 10 |
- strncpy(pc->path, str + 5, BUF_BIG - 1); /* cut off ``mbox:'' */
|
| 11 |
+ /* str is always pc.path, so we can't use strncpy */
|
| 12 |
+ int len = strlen(str + 5);
|
| 13 |
+ memmove(pc->path, str + 5, min(len, BUF_BIG - 1)); /* cut off ``mbox:'' */
|
| 14 |
+ pc->path[len] = '\0';
|
| 15 |
}
|
| 16 |
}
|
| 17 |
|