|
From: <arn...@us...> - 2008-03-06 18:14:10
|
Revision: 1027
http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1027&view=rev
Author: arnetheduck
Date: 2008-03-06 10:13:47 -0800 (Thu, 06 Mar 2008)
Log Message:
-----------
Fix empty pm crash
Modified Paths:
--------------
dcplusplus/trunk/changelog.txt
dcplusplus/trunk/dcpp/NmdcHub.cpp
Modified: dcplusplus/trunk/changelog.txt
===================================================================
--- dcplusplus/trunk/changelog.txt 2008-03-05 21:23:05 UTC (rev 1026)
+++ dcplusplus/trunk/changelog.txt 2008-03-06 18:13:47 UTC (rev 1027)
@@ -41,6 +41,7 @@
* [L#195209] Fixed Ctrl+F that opens favorite hubs (poy)
* [L#194696] Fixed small memory leak
* Some unix compile fixes (thanks pavel andreev and yakov suraev)
+* [L#199192] [NMDC] Fixed crash on empty private message
-- 0.704 2007-12-14 --
* Hub lists added to utilize Coral's distributed network (ullner)
Modified: dcplusplus/trunk/dcpp/NmdcHub.cpp
===================================================================
--- dcplusplus/trunk/dcpp/NmdcHub.cpp 2008-03-05 21:23:05 UTC (rev 1026)
+++ dcplusplus/trunk/dcpp/NmdcHub.cpp 2008-03-06 18:13:47 UTC (rev 1027)
@@ -690,10 +690,14 @@
if(fromNick.empty())
return;
+ if(param.size() < j + 2) {
+ return;
+ }
+ string msg = param.substr(j + 2);
+
OnlineUser* replyTo = findUser(rtNick);
OnlineUser* from = findUser(fromNick);
- string msg = param.substr(j + 2);
if(replyTo == NULL || from == NULL) {
if(replyTo == 0) {
// Assume it's from the hub
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|