--- a/mcabber/src/commands.c Thu Oct 30 19:47:11 2008 +0100
+++ b/mcabber/src/commands.c Fri Jan 16 22:26:51 2009 +0100
@@ -1459,7 +1459,7 @@
}
// Check for an option parameter
- while (TRUE) {
+ while (*paramlst) {
if (!strcmp(*paramlst, "-q")) {
char **oldparamlst = paramlst;
paramlst = split_arg(*(oldparamlst+1), 2, 1); // jid, message
@@ -1469,6 +1469,10 @@
char **oldparamlst = paramlst;
paramlst = split_arg(*(oldparamlst+1), 2, 1); // filename, jid
free_arg_lst(oldparamlst);
+ if (!*paramlst) {
+ scr_LogPrint(LPRINT_NORMAL, "Wrong usage.");
+ return;
+ }
file = g_strdup(*paramlst);
// One more parameter shift...
oldparamlst = paramlst;
@@ -1478,6 +1482,11 @@
break;
}
+ if (!*paramlst) {
+ scr_LogPrint(LPRINT_NORMAL, "Wrong usage.");
+ return;
+ }
+
fjid = *paramlst;
msg = *(paramlst+1);