|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-11 06:01 UTC] richard at bradders2000 dot co dot uk
[2003-08-11 11:38 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 12:00:01 2025 UTC |
Description: ------------ When a message is > 1024 bytes in size and therefore broken down into 1024 chunks, there is a 'goto send_chunk;' being called an infinite number of times because the conditional statement 'if ((parts * 1024) < data_cln_len)' is always true if it is ever true. This basically causes the function to just keep on sending data to the smtp server. Problem wasnt there in RC1, just RC2 and RC3. Reproduce code: --------------- int parts = (int) floor(data_cln_len / 1024); p = data_cln; for (i = 0; i < parts; i++) { strlcpy(Buffer, p, 1024); Buffer[1024] = '\0'; p += 1024; send_chunk: /* send chunk */ if ((res = Post(Buffer)) != SUCCESS) { efree(data_cln); return (res); } } if ((parts * 1024) < data_cln_len) { i = data_cln_len - (parts * 1024); strlcpy(Buffer, p, i); Buffer[i] = '\0'; goto send_chunk; } Expected result: ---------------- Data is sent in 1024 byte chunks. The remainder is then sent. Send is then terminated with '\r\n.\r\n' Actual result: -------------- Data is sent in 1024 byte chunks. The remainder is then sent...again and again and again and again. etc etc. Send is never terminated.