cvs: /php3/functions imap.c
| From: | Andrew Skalski | Date: | Fri, 28 Jan 2000 19:51:18 +0000 |
| Subject: | cvs: /php3/functions imap.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14995@lists.php.net to get a copy of this message | ||
askalski Fri Jan 28 11:51:18 2000 EDT
Modified files:
/php3/functions imap.c
Log:
null-terminate strings returned by imap_utf7_decode/encode
Index: php3/functions/imap.c
diff -u php3/functions/imap.c:1.80 php3/functions/imap.c:1.81
--- php3/functions/imap.c:1.80 Tue Jan 18 11:48:47 2000
+++ php3/functions/imap.c Fri Jan 28 11:51:18 2000
@@ -33,7 +33,7 @@
| Andrew Skalski <askalski@chek.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: imap.c,v 1.80 2000/01/18 19:48:47 askalski Exp $ */
+/* $Id: imap.c,v 1.81 2000/01/28 19:51:18 askalski Exp $ */
#define IMAP41
@@ -2625,7 +2625,7 @@
}
/* allocate output buffer */
- if ((out = emalloc(outlen)) == NULL) {
+ if ((out = emalloc(outlen + 1)) == NULL) {
php3_error(E_WARNING, "imap_utf7_decode: "
"Unable to allocate result string");
RETURN_FALSE;
@@ -2673,6 +2673,8 @@
}
}
+ *outp = 0;
+
#if DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
@@ -2746,7 +2748,7 @@
}
/* allocate output buffer */
- if ((out = emalloc(outlen)) == NULL) {
+ if ((out = emalloc(outlen + 1)) == NULL) {
php3_error(E_WARNING, "imap_utf7_encode: "
"Unable to allocate result string");
RETURN_FALSE;
@@ -2796,6 +2798,8 @@
}
}
}
+
+ *outp = 0;
#if DEBUG
/* warn if we computed outlen incorrectly */