McKael / mcabber (http://mcabber.com)

Mirror of the mcabber upstream repository. MCabber is a small Jabber console client.

Clone this repository (size: 5.2 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/McKael/mcabber/
commit 1562: 248da27faff3
parent 1561: 2e86c1cc4eb1
branch: default
Fix segfault when using /say_to with a bad syntax (reported by ISBear)
Mikael Berthe / McKael
14 months ago

Changed (Δ192 bytes):

raw changeset »

mcabber/src/commands.c (10 lines added, 1 lines removed)

Up to file-list mcabber/src/commands.c:

@@ -1459,7 +1459,7 @@ static void do_say_to(char *arg)
1459
1459
  }
1460
1460
1461
1461
  // Check for an option parameter
1462
  while (TRUE) {
1462
  while (*paramlst) {
1463
1463
    if (!strcmp(*paramlst, "-q")) {
1464
1464
      char **oldparamlst = paramlst;
1465
1465
      paramlst = split_arg(*(oldparamlst+1), 2, 1); // jid, message
@@ -1469,6 +1469,10 @@ static void do_say_to(char *arg)
1469
1469
      char **oldparamlst = paramlst;
1470
1470
      paramlst = split_arg(*(oldparamlst+1), 2, 1); // filename, jid
1471
1471
      free_arg_lst(oldparamlst);
1472
      if (!*paramlst) {
1473
        scr_LogPrint(LPRINT_NORMAL, "Wrong usage.");
1474
        return;
1475
      }
1472
1476
      file = g_strdup(*paramlst);
1473
1477
      // One more parameter shift...
1474
1478
      oldparamlst = paramlst;
@@ -1478,6 +1482,11 @@ static void do_say_to(char *arg)
1478
1482
      break;
1479
1483
  }
1480
1484
1485
  if (!*paramlst) {
1486
    scr_LogPrint(LPRINT_NORMAL, "Wrong usage.");
1487
    return;
1488
  }
1489
1481
1490
  fjid = *paramlst;
1482
1491
  msg = *(paramlst+1);
1483
1492