Mercurial > pidgin
comparison src/proxy.c @ 13404:c74401cfef23
[gaim-migrate @ 15779]
If Content-Length is the last header the \r is already replaced with \0.
Fixes CID 39
committer: Tailor Script <tailor@pidgin.im>
author | Thomas Butter <tbutter> |
---|---|
date | Mon, 06 Mar 2006 19:31:58 +0000 |
parents | 54f679516b52 |
children | 95cc25e78ef6 |
comparison
equal
deleted
inserted
replaced
13403:20d8b97a07be | 13404:c74401cfef23 |
---|---|
1157 gchar *tmp; | 1157 gchar *tmp; |
1158 int len = 0; | 1158 int len = 0; |
1159 char tmpc; | 1159 char tmpc; |
1160 p += strlen("Content-Length: "); | 1160 p += strlen("Content-Length: "); |
1161 tmp = strchr((const char *)p, '\r'); | 1161 tmp = strchr((const char *)p, '\r'); |
1162 *tmp = '\0'; | 1162 if(tmp) |
1163 *tmp = '\0'; | |
1163 len = atoi((const char *)p); | 1164 len = atoi((const char *)p); |
1164 *tmp = '\r'; | 1165 if(tmp) |
1166 *tmp = '\r'; | |
1165 | 1167 |
1166 /* Compensate for what has already been read */ | 1168 /* Compensate for what has already been read */ |
1167 len -= phb->read_len - headers_len; | 1169 len -= phb->read_len - headers_len; |
1168 /* I'm assuming that we're doing this to prevent the server from | 1170 /* I'm assuming that we're doing this to prevent the server from |
1169 complaining / breaking since we don't read the whole page */ | 1171 complaining / breaking since we don't read the whole page */ |