Message181017
| Author |
sanyi |
| Recipients |
orsenthil, sanyi |
| Date |
2013年01月31日.13:03:22 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1359637403.2.0.0380268630746.issue16904@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Renamed the report since it's unsafe for sure.
This problem was previously called: Avoid unnecessary and possibly unsafe code from http.client.HTTPConnection.send.
Imagine that the data parameter from HTTPConnection it's a file like object but it's not iterable, maybe some custom data wrapper.
the if hasattr(data, "read"): True branch will correctly send out the response then unnecessary continue to:
try:
self.sock.sendall(data)
except TypeError:
if isinstance(data, collections.Iterable):
for d in data:
self.sock.sendall(d)
else:
raise TypeError("data should be a bytes-like object "
"or an iterable, got %r" % type(data))
and crash! |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年01月31日 13:03:23 | sanyi | set | recipients:
+ sanyi, orsenthil |
| 2013年01月31日 13:03:23 | sanyi | set | messageid: <1359637403.2.0.0380268630746.issue16904@psf.upfronthosting.co.za> |
| 2013年01月31日 13:03:23 | sanyi | link | issue16904 messages |
| 2013年01月31日 13:03:22 | sanyi | create |
|