Project

General

Profile

ircfuzz-fixes.patch

sandsmark, 01/28/2012 02:56 PM

View differences:

src/core/coresessioneventprocessor.cpp
665 665

  
666 666
/* ERR_ERRONEUSNICKNAME */
667 667
void CoreSessionEventProcessor::processIrcEvent432(IrcEventNumeric *e) {
668
  if(!checkParamCount(e, 1))
669
    return;
670

  
668 671
  QString errnick;
669 672
  if(e->params().count() < 2) {
670 673
    // handle unreal-ircd bug, where unreal ircd doesnt supply a TARGET in ERR_ERRONEUSNICKNAME during registration phase:
src/core/eventstringifier.cpp
94 94

  
95 95
  // Server error messages, display them in red. First param will be appended.
96 96
  case 401: {
97
    if(!checkParamCount(e, 1))
98
      return;
99

  
97 100
    QString target = e->params().takeFirst();
98 101
    displayMsg(e, Message::Error, e->params().join(" ") + " " + target, e->prefix(), target, Message::Redirected);
99 102
    break;
100 103
  }
101 104

  
102 105
  case 402: case 403: case 404: case 406: case 408: case 415: case 421: case 442: {
106
    if(!checkParamCount(e, 1))
107
      return;
108

  
103 109
    QString channelName = e->params().takeFirst();
104 110
    displayMsg(e, Message::Error, e->params().join(" ") + " " + channelName, e->prefix());
105 111
    break;
......
110 116
  case 467: case 471: case 473: case 474: case 475: case 476: case 477: case 478: case 482:
111 117
  case 436: // ERR_NICKCOLLISION
112 118
  {
119
    if(!checkParamCount(e, 1))
120
      return;
121

  
113 122
    QString p = e->params().takeFirst();
114 123
    displayMsg(e, Message::Error, p + ": " + e->params().join(" "));
115 124
    break;
......
475 484

  
476 485
/* ERR_ERRONEUSNICKNAME */
477 486
void EventStringifier::processIrcEvent432(IrcEvent *e) {
487
  if(!checkParamCount(e, 1))
488
    return;
489

  
478 490
  displayMsg(e, Message::Error, tr("Nick %1 contains illegal characters").arg(e->params()[0]));
479 491
}
480 492

  
481 493
/* ERR_NICKNAMEINUSE */
482 494
void EventStringifier::processIrcEvent433(IrcEvent *e) {
495
  if(!checkParamCount(e, 1))
496
    return;
497

  
483 498
  displayMsg(e, Message::Error, tr("Nick already in use: %1").arg(e->params()[0]));
484 499
}
485 500

  
486 501
/* ERR_UNAVAILRESOURCE */
487 502
void EventStringifier::processIrcEvent437(IrcEvent *e) {
503
  if(!checkParamCount(e, 1))
504
    return;
505

  
488 506
  displayMsg(e, Message::Error, tr("Nick/channel is temporarily unavailable: %1").arg(e->params()[0]));
489 507
}
490 508

  
src/core/ircparser.cpp
275 275
      break;
276 276

  
277 277
    case 333:  /* Topic set by... */
278
      if(params.count() >= 2) {
278
      if(params.count() >= 3) {
279 279
        QString channel = net->serverDecode(params.at(0));
280 280
        decParams << channel << net->serverDecode(params.at(1));
281 281
        decParams << net->channelDecode(channel, params.at(2));
282
-