[hackers] [sic] fix IPv6 parse error

From: <raiz_AT_firemail.cc>
Date: Mon, 24 Apr 2017 11:21:57 +0000

I'm not sure if I've submitted this before.

diff --git a/sic.c b/sic.c
index ecefaf2..bceb823 100644
--- a/sic.c
+++ b/sic.c
_AT_@ -108,6 +108,7 @@ parsein(char *s) {

  static void
  parsesrv(char *cmd) {
+ char *ptr;
          char *usr, *par, *txt;

          usr = host;
_AT_@ -122,7 +123,13 @@ parsesrv(char *cmd) {
          }
          skip(cmd, '\r');
          par = skip(cmd, ' ');
- txt = skip(par, ':');
+ ptr = par;
+ if ((ptr = strstr(par, " :")) == NULL) {
+ txt = skip(par, ' ');
+ } else {
+ *ptr = '\0';
+ txt = ptr+2;
+ }
          trim(par);
          if(!strcmp("PONG", cmd))
                  return;
Received on Mon Apr 24 2017 - 13:21:57 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 24 2017 - 13:24:21 CEST