mirror of https://github.com/aria2/aria2
				
				
				
			2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed segmentation fault when a DHT message which doesn't have 'y' key received. * src/DHTMessageReceiver.cc (receiveMessage)pull/1/head
							parent
							
								
									c4aaea3ca2
								
							
						
					
					
						commit
						1ea9033363
					
				|  | @ -1,3 +1,9 @@ | |||
| 2008-02-21  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com> | ||||
| 
 | ||||
| 	Fixed segmentation fault when a DHT message which doesn't have 'y' key | ||||
| 	received. | ||||
| 	* src/DHTMessageReceiver.cc (receiveMessage)  | ||||
| 
 | ||||
| 2008-02-21  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com> | ||||
| 
 | ||||
| 	Fixed the bug that a return code is always 0. BUG#1897704 | ||||
|  |  | |||
|  | @ -78,8 +78,13 @@ SharedHandle<DHTMessage> DHTMessageReceiver::receiveMessage() | |||
|     const Dictionary* d = dynamic_cast<const Dictionary*>(msgroot.get()); | ||||
|     if(d) { | ||||
|       const Data* y = dynamic_cast<const Data*>(d->get("y")); | ||||
|       if(y->toString() == "r" || y->toString() == "e") { | ||||
| 	isReply = true; | ||||
|       if(y) { | ||||
| 	if(y->toString() == "r" || y->toString() == "e") { | ||||
| 	  isReply = true; | ||||
| 	} | ||||
|       } else { | ||||
| 	_logger->info("Malformed DHT message. Missing 'y' key. From:%s:%u", remoteAddr.c_str(), remotePort); | ||||
| 	return handleUnknownMessage(data, sizeof(data), remoteAddr, remotePort); | ||||
|       } | ||||
|     } else { | ||||
|       _logger->info("Malformed DHT message. This is not a bencoded directory. From:%s:%u", remoteAddr.c_str(), remotePort); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Tatsuhiro Tsujikawa
						Tatsuhiro Tsujikawa