#22031 [NEW]: output containing null bytes is truncated in curl_write()
| From: | radu dot rendec at ines dot ro | Date: | Mon, 03 Feb 2003 16:17:53 +0000 |
| Subject: | #22031 [NEW]: output containing null bytes is truncated in curl_write() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-31987@lists.php.net to get a copy of this message | ||
From: radu.rendec@ines.ro
Operating system: any
PHP version: 4.3.0
PHP Bug Type: cURL related
Bug description: output containing null bytes is truncated in curl_write()
It looks like there is a bug in the curl_write() function of
ext/curl/curl.c:
In the case PHP_CURL_STDOUT (line 337), PUTS() is used. A buffer
containing null bytes will be echoed up to the first null byte (which will
be interpreted as a null terminator by puts), and the rest will be
discarded, regardless of 'size' and 'nmemb'.
I suggest using PHPWRITE(data, length) instead of PUTS(data). This ensures
that the whole buffer is echoed, even if it contains null bytes.
--
Edit bug report at http://bugs.php.net/?id=22031&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22031&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22031&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22031&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22031&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22031&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22031&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22031&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22031&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22031&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22031&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22031&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22031&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22031&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22031&r=gnused