diff options
author | denis <> | 2006-12-07 22:38:35 +0000 |
---|---|---|
committer | denis <> | 2006-12-07 22:38:35 +0000 |
commit | 88679832f066d35d3b1fadba0ef13bf42a54cd15 (patch) | |
tree | da629b1cf2ac36ccc3c0edf48e3f2548fbf3670b | |
parent | 0a3dc7b4cee9de4e69fcfcbc4d22579065f9f423 (diff) |
nochma
-rw-r--r-- | opentracker.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/opentracker.c b/opentracker.c index 0034ec5..d2df803 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -130,6 +130,7 @@ e400: | |||
130 | { | 130 | { |
131 | // info_hash, left, port, numwant, compact | 131 | // info_hash, left, port, numwant, compact |
132 | struct ot_peer peer; | 132 | struct ot_peer peer; |
133 | ot_hash hash; | ||
133 | byte_copy( peer.ip, h->ip, 4); | 134 | byte_copy( peer.ip, h->ip, 4); |
134 | peer.port = 6881; | 135 | peer.port = 6881; |
135 | 136 | ||
@@ -137,10 +138,14 @@ e400: | |||
137 | while( *c!=' ' ) { | 138 | while( *c!=' ' ) { |
138 | if(!byte_diff(c,10,"info_hash=")) | 139 | if(!byte_diff(c,10,"info_hash=")) |
139 | { | 140 | { |
141 | size_t destlen = 20; | ||
140 | // String is expected to be URL encoded, so expect | 142 | // String is expected to be URL encoded, so expect |
141 | // (%[0-9A-F][0-9A-F]){20} | 143 | // (%[0-9A-F][0-9A-F]){20} |
142 | int s = scan_urlencoded( | 144 | |
143 | 145 | int s = scan_urlencoded( c+10, hash, &destlen); | |
146 | if( c[s+10] != '&' ) | ||
147 | goto e_parse; | ||
148 | |||
144 | } | 149 | } |
145 | else if(!byte_diff(c,8,"numwant=")) | 150 | else if(!byte_diff(c,8,"numwant=")) |
146 | { | 151 | { |