Using UpnpReadHttpGet to download large files causes the application to

crash. This happens when the file being downloaded exceeds the device
memory - entirely possible when transferring video files.
The programmatic cause is that the logic implemented in the function
http_ReadHttpGet (which UpnpReadHttpGet calls) reads the entire file
into memory. The fix modifies the existing logic to discard data after
it's been read; there's no reason to keep it around since the caller
of UpnpReadHttpGet already has a copy of it.

This issue exists in 1.6.6 as well as the latest sources.

Patch submitted by Chandra (inactiveneurons).
This commit is contained in:
Marcelo Roberto Jimenez
2010-09-07 22:15:21 -03:00
parent 21660334e4
commit 4657e57766
4 changed files with 49 additions and 32 deletions

View File

@@ -193,7 +193,8 @@ typedef struct // http_message_t
// private fields
membuffer msg; // entire raw message
char *urlbuf; // storage for url string
char *urlbuf; // storage for url string
size_t entity_offset;
} http_message_t;
typedef struct // http_parser_t