cURL / Mailing Lists / curl-users / Single Mail

curl-users

NULLs in binary input file result in mangled request?

From: <curl-users_at_cool.haxx.se_at_textnode.com>
Date: Thu, 13 Oct 2005 12:55:14 +0000

First post to the list, so hi folks!

I want to run this by you - it was found when using cURLpp, but is reproducible on the commandline. It may be a problem with my usage of cURL.

I'm using the commandline version of cURL to POST a Nokia EAIF message to a listening system.

The commandline is as follows:

/usr/local/bin/curl --verbose --data-binary @eaif_post.bin -H "Content-Type: application/vnd.wap.mms-message" -H "x-nokia-mmsc-message-type: MultiMediaMessage" -H "x-nokia-mmsc-version: 2.0" http://mmsc/eaif

The file eaif_post.bin contains a binary payload which has NULLs present in various places.

When the request is sent out, a snoop with ethereal shows that the HTTP POST contains content matching the contents of the file eaif_post.bin only up to the first NULL.

>From that point onwards the request contains garbage (seemingly random bytes). During various executions this has contained garbage including entries from /etc/hosts, snippets of previous requests and other unintelligible junk.

Has anyone else seen this behaviour? Or can anyone reproduce it?

Many Thanks,
Darren Elwood

curl --version

curl 7.14.0 (i686-pc-linux-gnu) libcurl/7.14.0 OpenSSL/0.9.7a zlib/1.1.4
Protocols: ftp gopher telnet dict ldap http file https ftps
Features: Largefile NTLM SSL libz

uname -a

Linux machinename.removed.com 2.4.21-20.EL #1 Wed Aug 18 20:58:25 EDT 2004 i686 i686 i386 GNU/Linux

url:

anything pointing to a listening system

Apart from the nulls being present, I don't think the actual file contents are important, but here are the contents of the file eaif_post.bin after base64 encoding (my mail client doesn't support file attaching):

jICYRTBEODYxMDYxNzJFQ0IAjZCJGYAr
NDQ3NzY2NDc3OTk3L1RZUEU9UExNTgCX
KzQ0Nzc3Nzc3Nzc3Ny9UWVBFPVBMTU4A
lys0NDc3Nzc3Nzc3NzcvVFlQRT1QTE1O
AIErNDQ3Nzc3Nzc3Nzc3L1RZUEU9UExN
TgCCKzQ0Nzc3Nzc3Nzc3Ny9UWVBFPVBM
TU4AioCPgYaBkIGEHyCzijwxODA3OTcw
OTk+AIlhcHBsaWNhdGlvbi9zbWlsAAIg
DBGDgeqFVGVzdF9tZXMudHh0AI5UZXN0
X21lcy50eHQAVGVzdCBtZXNzYWdlLYIF
HmFwcGxpY2F0aW9uL3NtaWwAgeqFcHJl
cy5zbWlsAMAiPDE4MDc5NzA5OT4ADQo8
c21pbD4NCjxoZWFkPg0KPGxheW91dD4N
Cjxyb290LWxheW91dCB3aWR0aD0iMTc2
IiBoZWlnaHQ9IjIwOCIvPg0KPHJlZ2lv
biBpZD0iVGV4dCIgd2lkdGg9IjE2MCIg
aGVpZ2h0PSIxODMiIHRvcD0iNSIgbGVm
dD0iOCIgZml0PSJzY3JvbGwiLz4NCjwv
bGF5b3V0Pg0KPC9oZWFkPg0KPGJvZHk+
DQo8cGFyIGR1cj0iNTAwMG1zIj4NCjx0
ZXh0IHJlZ2lvbj0iVGV4dCIgc3JjPSJU
ZXN0X21lcy50eHQiLz4NCjwvcGFyPg0K
PC9ib2R5Pg0KPC9zbWlsPg0K
Received on 2005-10-13