|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-28 08:49 UTC] adv at mdgrosse dot net
Description: ------------ I have an POP3-account with several 1000 mails. When I call pop3_get_message I occasionally get a memory access error. Reproduce code: --------------- I think the problem lies in the _pop3_fetch_message_part function. It can happen that the ending '\0' is written beyond the buffer. Proposed solution: Reserve "size+1" bytes memory. PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
my POP3 account currently holds 3617 mails, and I get: Mailbox message count: 3617 zend_mm_heap corrupted I tried increasing the memory by one byte as you suggested, but still no go; I hope I did it at the right place - and that's what you mean?? --- pop3.c.orig Mon Jul 25 23:47:04 2005 +++ pop3.c Thu Nov 08 17:39:19 2007 @@ -172,8 +172,12 @@ intern = emalloc(sizeof(pop3_object)); intern->zo.ce = class_type; +#if ZEND_MODULE_API_NO >= 20050922 + intern->zo.guards = NULL; +#else intern->zo.in_get = 0; intern->zo.in_set = 0; +#endif /* ZEND_MODULE_API_NO >= 20050922 */ intern->zo.properties = NULL; intern->ptr = NULL; @@ -750,7 +754,7 @@ } size = 2048; - result = emalloc(size); + result = emalloc(size + 1); length = 0; do {