Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008329opensim[GRID] Asset Servicepublic2018-06-13 05:162018-06-17 17:09
Reporterevilissimo 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Statuspatch includedResolutionopen 
PlatformLinuxOSLinuxOS Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0008329: WebUtil: Deserialization failures in LogAndDeserialize
DescriptionSome servers respond with no ContentLength or -1 when they use Transfer-Encoding: chunked

Here some example:

* Connected to some-assets.server.example.com (666.666.666.666) port 80 (#0)
> GET /assets/803e5f49-9b89-4a0c-9d96-fe2e700092a9/ HTTP/1.1
> Host: some-assets-server.example.com
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: some-assets-server.example.com
< Date: Wed, 13 Jun 2018 11:41:25 GMT
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Expires: Wed, 20 Jun 2018 11:41:25 GMT
< Cache-Control: max-age=604800
< X-Cache: MISS
< X-Edge-Location: defr
< Access-Control-Allow-Origin: *
<
....


This will result in a "System.OverflowException: Arithmetic operation resulted in an overflow" when WebUtil.DebugLevel >= 5

in XMLResponseHelper.LogAndDeserialize there's no check if contentLength is actually sane
    byte[] data = new byte[contentLength];

And -1 will cause Util.ReadStream(respStream, data); to raise the above exception.

TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineubODE
EnvironmentUnknown
Mono VersionOther
Viewer
Attached Filespatch file icon 0001-WebUtil-Fix-System.OverflowException-for-chunked-con.patch [^] (1,807 bytes) 2018-06-13 05:36 [Show Content]

- Relationships

-  Notes
(0032694)
UbitUmarov (administrator)
2018-06-13 10:30

Transfer-Encoding: chunked is not supported.
your patch may avoid the error caused by missing contentLength, but may not fix contents.
(0032695)
tampa (reporter)
2018-06-13 11:02

From what I understand this just combines the data into one; additional routines should then handle the response depending on what it is, but those already exist to handle a regular response. This just transforms the chunked response into a regular one, no?
(0032716)
UbitUmarov (administrator)
2018-06-17 17:09

added a bit diferente code to httptests branch.

- Issue History
Date Modified Username Field Change
2018-06-13 05:16 evilissimo New Issue
2018-06-13 05:36 evilissimo File Added: 0001-WebUtil-Fix-System.OverflowException-for-chunked-con.patch
2018-06-13 05:37 evilissimo Status new => patch included
2018-06-13 10:30 UbitUmarov Note Added: 0032694
2018-06-13 11:02 tampa Note Added: 0032695
2018-06-17 17:09 UbitUmarov Note Added: 0032716


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker