cpw.qulogic.msn: b062f14d: Avoid a NULL reference in msn_command_fr...

qulogic at pidgin.im qulogic at pidgin.im
Sat Jun 21 04:01:18 EDT 2008


-----------------------------------------------------------------
Revision: b062f14d1bcd8e6c28b2b05977aa19a4bfd4867c
Ancestor: c6431ba384b42e202692fcba282a913d9a0dca2a
Author: qulogic at pidgin.im
Date: 2008-06-21T06:50:53
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/b062f14d1bcd8e6c28b2b05977aa19a4bfd4867c

Modified files:
        libpurple/protocols/msn/command.c

ChangeLog: 

Avoid a NULL reference in msn_command_from_string.

References #5545.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/command.c	54bb388e33c487a6294b2953daa2c1b11b6149fb
+++ libpurple/protocols/msn/command.c	5c706023ef1e6a4154625f275ff874f51b54a33a
@@ -107,15 +107,17 @@ msn_command_from_string(const char *stri
 
 	if (cmd->params != NULL)
 	{
-		char *param;
 		int c;
 
 		for (c = 0; cmd->params[c]; c++);
 		cmd->param_count = c;
 
-		param = cmd->params[0];
-
-		cmd->trId = is_num(param) ? atoi(param) : 0;
+		if (cmd->param_count) {
+			char *param = cmd->params[0];
+			cmd->trId = is_num(param) ? atoi(param) : 0;
+		} else {
+			cmd->trId = 0;
+		}
 	}
 	else
 	{


More information about the Commits mailing list