OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Thomas Lotterer
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   19-Mar-2003 14:57:05
  Branch: OPENPKG_1_2_SOLID                Handle: 2003031913570500

  Added files:              (Branch: OPENPKG_1_2_SOLID)
    openpkg-src/ircii       ircii.patch
  Modified files:           (Branch: OPENPKG_1_2_SOLID)
    openpkg-src/ircii       ircii.spec

  Log:
    OpenPKG-SA-2003.024-ircii

  Summary:
    Revision    Changes     Path
    1.1.2.1     +786 -0     openpkg-src/ircii/ircii.patch
    1.32.2.1.2.2+3  -1      openpkg-src/ircii/ircii.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/ircii/ircii.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1.2.1 ircii.patch
  --- /dev/null 2003-03-19 14:57:05.000000000 +0100
  +++ ircii.patch       2003-03-19 14:57:05.000000000 +0100
  @@ -0,0 +1,786 @@
  +From: Timo Sirainen <[EMAIL PROTECTED]>
  +Subject: Buffer overflows in ircII-based clients
  +Date: 14 Mar 2003 00:17:55 +0200
  +Message-ID: <[EMAIL PROTECTED]>
  +
  +    ircii 20020912
  +
  +    1) [sample IRC commands] overflows ctcp_buffer [...]
  +    2) cannot_join_channel() allows writing [...] past buffer in stack [...]
  +    3) Statusbar drawing has several buffer overflows. [...]
  +    4) Some of the other my_strcat() calls may overflow buffer [...]
  +
  +    ircii-20030313 fixes these.
  +
  +This patch was created by extracting differences from vendor sources by
  +the [EMAIL PROTECTED] team. It can be applied to
  +ircii-20020403 and ircii-20021103.
  +
  +--- ircii-20021103/source/alias.c    Wed Sep  4 18:56:40 2002
  ++++ ircii-20030315/source/alias.c    Thu Mar 13 12:34:27 2003
  +@@ -2923,10 +2923,10 @@
  +             if ((Client->flags & (DCC_CHAT|DCC_ACTIVE)) == (DCC_CHAT|DCC_ACTIVE))
  +             {
  +                     if (notfirst)
  +-                            my_strcat(result, ",");
  ++                            my_strmcat(result, ",", len);
  +                     else
  +                             notfirst = 1;
  +-                    my_strcat(result, Client->user);
  ++                    my_strmcat(result, Client->user, len);
  +             }
  + 
  +     return (result);
  +@@ -3419,10 +3419,10 @@
  +     for (nicks = chan->nicks; nicks; nicks = nicks->next)
  +     {
  +             if (notfirst)
  +-                    my_strcat(result, " ");
  ++                    my_strmcat(result, " ", len);
  +             else
  +                     notfirst = 1;
  +-            my_strcat(result, nicks->nick);
  ++            my_strmcat(result, nicks->nick, len);
  +     }
  + 
  +     return (result);
  +--- ircii-20021103/source/ctcp.c     Tue Sep  3 04:39:30 2002
  ++++ ircii-20030315/source/ctcp.c     Thu Mar 13 12:34:27 2003
  +@@ -606,7 +606,7 @@
  +             if (messages > 3)
  +                     break;
  +             *(cmd++) = '\0';
  +-            my_strcat(ctcp_buffer, str);
  ++            my_strmcat(ctcp_buffer, str, BIG_BUFFER_SIZE);
  +             if ((end = my_index(cmd, CTCP_DELIM_CHAR)) != NULL)
  +             {
  +                     messages++;
  +@@ -631,7 +631,7 @@
  +                                             ptr = ctcp_cmd[i].func(&ctcp_cmd[i], 
from, to, arg_copy);
  +                                             if (ptr)
  +                                             {
  +-                                                    my_strcat(ctcp_buffer, ptr);
  ++                                                    my_strmcat(ctcp_buffer, ptr, 
BIG_BUFFER_SIZE);
  +                                                     new_free(&ptr);
  +                                             }
  +                                     }
  +@@ -678,7 +678,7 @@
  +             }
  +             else
  +             {
  +-                    my_strcat(ctcp_buffer, CTCP_DELIM_STR);
  ++                    my_strmcat(ctcp_buffer, CTCP_DELIM_STR, BIG_BUFFER_SIZE);
  +                     str = cmd;
  +             }
  +     }
  +@@ -759,7 +759,7 @@
  +             *CTCP_Reply_Buffer = '\0';
  +     }
  +     if (*str)
  +-            my_strcat(ctcp_buffer, str);
  ++            my_strmcat(ctcp_buffer, str, BIG_BUFFER_SIZE);
  +     return (ctcp_buffer);
  + }
  + 
  +@@ -791,7 +791,7 @@
  +             while ((cmd = my_index(str, CTCP_DELIM_CHAR)) != NULL)
  +                     do_new_notice_ctcp(from, to, &str, cmd);
  +     in_ctcp_flag = 0;
  +-    my_strcat(ctcp_buffer, str);
  ++    my_strmcat(ctcp_buffer, str, BIG_BUFFER_SIZE);
  +     return (ctcp_buffer);
  + }
  + 
  +@@ -812,7 +812,7 @@
  + 
  +     flags = 0;
  +     *(cmd++) = '\0';
  +-    my_strcat(ctcp_buffer, *str);
  ++    my_strmcat(ctcp_buffer, *str, BIG_BUFFER_SIZE);
  +     if ((end = my_index(cmd, CTCP_DELIM_CHAR)) != NULL)
  +     {
  +             *(end++) = '\0';
  +@@ -825,7 +825,7 @@
  +                     {
  +                             if ((ptr = ctcp_cmd[i].func(&(ctcp_cmd[i]), from, to, 
arg_copy)) != NULL)
  +                             {
  +-                                    my_strcat(ctcp_buffer, ptr);
  ++                                    my_strmcat(ctcp_buffer, ptr, BIG_BUFFER_SIZE);
  +                                     new_free(&ptr);
  +                                     flags = ctcp_cmd[i].flag;
  +                             }
  +@@ -866,7 +866,7 @@
  +     }
  +     else
  +     {
  +-            my_strcat(ctcp_buffer, CTCP_DELIM_STR);
  ++            my_strmcat(ctcp_buffer, CTCP_DELIM_STR, BIG_BUFFER_SIZE);
  +             *str = cmd;
  +     }
  + }
  +--- ircii-20021103/source/dcc.c      Tue Sep 10 15:04:56 2002
  ++++ ircii-20030315/source/dcc.c      Thu Mar 13 12:34:27 2003
  +@@ -844,7 +847,7 @@
  +     }
  +     if (IS_ABSOLUTE_PATH(filename))
  +     {
  +-            my_strcpy(FileBuf, filename);
  ++            my_strmcpy(FileBuf, filename, BIG_BUFFER_SIZE);
  +     }
  +     else if (*filename == '~')
  +     {
  +@@ -853,14 +856,14 @@
  +                     yell("Unable to expand %s", filename);
  +                     return;
  +             }
  +-            my_strcpy(FileBuf, fullname);
  ++            my_strmcpy(FileBuf, fullname, BIG_BUFFER_SIZE);
  +             new_free(&fullname);
  +     }
  +     else
  +     {
  +             getcwd(CP(FileBuf), sizeof(FileBuf));
  +-            my_strcat(FileBuf, "/");
  +-            my_strcat(FileBuf, filename);
  ++            my_strmcat(FileBuf, "/", BIG_BUFFER_SIZE);
  ++            my_strmcat(FileBuf, filename, BIG_BUFFER_SIZE);
  +     }
  +     if (0 != access(CP(FileBuf), R_OK))
  +     {
  +--- ircii-20021103/source/edit.c     Thu Oct 31 13:06:38 2002
  ++++ ircii-20030315/source/edit.c     Thu Mar 13 12:34:27 2003
  +@@ -1282,7 +1282,7 @@
  +                             *(s - 1) = '\0';
  +                     else
  +                             n--;
  +-                    my_strcpy(buffer, t);
  ++                    my_strmcpy(buffer, t, BIG_BUFFER_SIZE);
  +                     t = s;
  + 
  +                     if (userhost_cmd)
  +@@ -1735,11 +1735,11 @@
  +     u_char *dest;
  +     u_char *msg;
  + {
  +-    u_char  buffer[BIG_BUFFER_SIZE];
  ++    u_char  buffer[BIG_BUFFER_SIZE+1];
  + 
  +-    my_strcpy(buffer, dest);
  +-    my_strcat(buffer, " ");
  +-    my_strcat(buffer, msg);
  ++    my_strmcpy(buffer, dest, BIG_BUFFER_SIZE);
  ++    my_strmcat(buffer, " ", BIG_BUFFER_SIZE);
  ++    my_strmcat(buffer, msg, BIG_BUFFER_SIZE);
  +     e_privmsg("PRIVMSG", buffer, NULL);
  + }
  + 
  +@@ -2223,11 +2227,11 @@
  +                     {
  +                             if (*nick_list)
  +                             {
  +-                                    my_strcat(nick_list, ",");
  +-                                    my_strcat(nick_list, nick);
  ++                                    my_strmcat(nick_list, ",", IRCD_BUFFER_SIZE);
  ++                                    my_strmcat(nick_list, nick, IRCD_BUFFER_SIZE);
  +                             }
  +                             else
  +-                                    my_strcpy(nick_list, nick);
  ++                                    my_strmcpy(nick_list, nick, IRCD_BUFFER_SIZE);
  +                     }
  +                     do_final_send = 1;
  +             }
  +@@ -2265,11 +2269,11 @@
  +                     {
  +                             if (*nick_list)
  +                             {
  +-                                    my_strcat(nick_list, ",");
  +-                                    my_strcat(nick_list, nick);
  ++                                    my_strmcat(nick_list, ",", IRCD_BUFFER_SIZE);
  ++                                    my_strmcat(nick_list, nick, IRCD_BUFFER_SIZE);
  +                             }
  +                             else
  +-                                    my_strcpy(nick_list, nick);
  ++                                    my_strmcpy(nick_list, nick, IRCD_BUFFER_SIZE);
  +                     }
  + 
  +                     if (get_int_var(WARN_OF_IGNORES_VAR) && (is_ignored(nick, 
IGNORE_MSGS) == IGNORED))
  +--- ircii-20021103/source/funny.c    Thu Aug 29 12:26:38 2002
  ++++ ircii-20030315/source/funny.c    Thu Mar 13 12:34:27 2003
  +@@ -124,7 +124,6 @@
  +     int     i;
  +     u_char  buffer1[BIG_BUFFER_SIZE];
  +     u_char  buffer2[BIG_BUFFER_SIZE];
  +-    u_char  *ptr;
  + 
  +     if (!wide_list)
  +             return;
  +@@ -141,16 +140,13 @@
  +     {
  +             snprintf(CP(buffer2), sizeof buffer2, "%s(%d) ", wide_list[i]->channel,
  +                             wide_list[i]->users);
  +-            ptr = my_index(buffer1, '\0');
  +             if (my_strlen(buffer1) + my_strlen(buffer2) > current_screen->co - 5)
  +             {
  +                     if (do_hook(WIDELIST_LIST, "%s", buffer1))
  +                             say("%s", buffer1);
  +                     *buffer1 = '\0';
  +-                    my_strcat(buffer1, buffer2);
  +             }
  +-            else
  +-                    my_strcpy(ptr, buffer2);
  ++            my_strmcat(buffer1, buffer2, BIG_BUFFER_SIZE);
  +     }
  +     if (*buffer1 && do_hook(WIDELIST_LIST, "%s", buffer1))
  +             say("%s" , buffer1);
  +@@ -184,7 +180,7 @@
  +                             (u_char) last_width,
  +                             (u_char) last_width);
  +             else
  +-                    my_strcpy(format, "*** %s\t%-5s  %s");
  ++                    my_strmcpy(format, "*** %s\t%-5s  %s", sizeof format);
  +     }
  +     channel = ArgList[0];
  +     user_cnt = ArgList[1];
  +@@ -279,7 +275,7 @@
  +                             (u_char) last_width,
  +                             (u_char) last_width);
  +             else
  +-                    my_strcpy(format, "%s: %s\t%s");
  ++                    my_strmcpy(format, "%s: %s\t%s", sizeof format);
  +     }
  +     ptr = line;
  +     for (cnt = -1; ptr; cnt++)
  +--- ircii-20021103/source/help.c     Fri Oct  4 06:50:26 2002
  ++++ ircii-20030315/source/help.c     Thu Mar 13 12:34:27 2003
  +@@ -552,7 +552,7 @@
  +     u_char  *arg_z = (u_char *) 0;
  + #endif /* ZCAT */ 
  + 
  +-    my_strcpy(help_topic_list, topics);
  ++    my_strmcpy(help_topic_list, topics, BIG_BUFFER_SIZE);
  + 
  + #ifdef DAEMON_UID
  +     if (DAEMON_UID == getuid())
  +@@ -726,10 +726,10 @@
  +                     }
  +                     if (stat_buf.st_mode & S_IFDIR)
  +                     {
  +-                            my_strcpy(path, tmp);
  ++                            my_strmcpy(path, tmp, BIG_BUFFER_SIZE);
  +                             if (*help_topic_list)
  +-                                    my_strcat(help_topic_list, " ");
  +-                            my_strcat(help_topic_list, namelist[0]->d_name);
  ++                                    my_strmcat(help_topic_list, " ", 
BIG_BUFFER_SIZE);
  ++                            my_strmcat(help_topic_list, namelist[0]->d_name, 
BIG_BUFFER_SIZE);
  +                             if ((this_arg = next_arg(args, &args)) ==
  +                                             (u_char *) 0)
  +                             {
  +@@ -758,7 +758,7 @@
  +                     }
  +             default:
  +                     help_show_directory = 1;
  +-                    my_strcpy(paused_topic, help_topic_list);
  ++                    my_strmcpy(paused_topic, help_topic_list, sizeof paused_topic);
  +                     help_pause_add_line("*** %s choices:", help_topic_list);
  +                     *buffer = (u_char) 0;
  +                     cnt = 0;
  +--- ircii-20021103/source/ignore.c   Wed Mar 20 18:03:15 2002
  ++++ ircii-20030315/source/ignore.c   Thu Mar 13 12:34:27 2003
  +@@ -106,7 +106,7 @@
  +     Ignore  *new;
  +     char    *msg;
  +     u_char  *ptr;
  +-    u_char  buffer[BIG_BUFFER_SIZE];
  ++    u_char  buffer[BIG_BUFFER_SIZE+1];
  + 
  +     while (nick)
  +     {
  +@@ -197,25 +197,25 @@
  +                     }
  +                     else if (type)
  +                     {
  +-                            my_strcpy(buffer, msg);
  ++                            my_strmcpy(buffer, msg, BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_MSGS)
  +-                                    my_strcat(buffer, " MSGS");
  ++                                    my_strmcat(buffer, " MSGS", BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_PUBLIC)
  +-                                    my_strcat(buffer, " PUBLIC");
  ++                                    my_strmcat(buffer, " PUBLIC", BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_WALLS)
  +-                                    my_strcat(buffer, " WALLS");
  ++                                    my_strmcat(buffer, " WALLS", BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_WALLOPS)
  +-                                    my_strcat(buffer, " WALLOPS");
  ++                                    my_strmcat(buffer, " WALLOPS", 
BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_INVITES)
  +-                                    my_strcat(buffer, " INVITES");
  ++                                    my_strmcat(buffer, " INVITES", 
BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_NOTICES)
  +-                                    my_strcat(buffer, " NOTICES");
  ++                                    my_strmcat(buffer, " NOTICES", 
BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_NOTES)
  +-                                    my_strcat(buffer, " NOTES");
  ++                                    my_strmcat(buffer, " NOTES", BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_CTCPS)
  +-                                    my_strcat(buffer, " CTCPS");
  ++                                    my_strmcat(buffer, " CTCPS", BIG_BUFFER_SIZE);
  +                             if (type & IGNORE_CRAP)
  +-                                    my_strcat(buffer, " CRAP");
  ++                                    my_strmcat(buffer, " CRAP", BIG_BUFFER_SIZE);
  +                             say("%s from %s", buffer, new->nick);
  +                     }
  +                     if ((new->type == 0) && (new->high == 0))
  +--- ircii-20021103/source/ircaux.c   Thu Sep 12 08:28:12 2002
  ++++ ircii-20030315/source/ircaux.c   Thu Mar 13 12:34:27 2003
  +@@ -1160,7 +1164,7 @@
  +             if ((ptr = my_index(path, ':')) != NULL)
  + #endif /* __MSDOS */
  +                     *(ptr++) = '\0';
  +-            my_strcpy(lbuf, empty_string);
  ++            lbuf[0] = 0;
  +             if (path[0] == '~')
  +             {
  +                     my_strmcat(lbuf, my_path, BIG_BUFFER_SIZE);
  +--- ircii-20021103/source/names.c    Sun Sep  8 07:09:46 2002
  ++++ ircii-20030315/source/names.c    Sat Mar 15 05:53:54 2003
  +@@ -954,13 +958,13 @@
  + {
  +     ChannelList     *tmp;
  +     u_char  *value = (u_char *) 0;
  +-    u_char  buffer[BIG_BUFFER_SIZE];
  ++    u_char  buffer[BIG_BUFFER_SIZE+1];
  + 
  +     *buffer = '\0';
  +     for (tmp = server_list[window->server].chan_list; tmp; tmp = tmp->next)
  +     {
  +-            my_strcat(buffer, tmp->channel);
  +-            my_strcat(buffer, " ");
  ++            my_strmcat(buffer, tmp->channel, BIG_BUFFER_SIZE);
  ++            my_strmcat(buffer, " ", BIG_BUFFER_SIZE);
  +     }
  +     malloc_strcpy(&value, buffer);
  + 
  +--- ircii-20021103/source/notice.c   Tue Sep  3 04:39:31 2002
  ++++ ircii-20030315/source/notice.c   Fri Dec  6 15:33:17 2002
  +@@ -388,7 +388,7 @@
  +     else if ((c = server[strlen(server) - 1]) == ',' || c == '.')
  +             server[strlen(server) - 1] = '\0';
  + #endif /* BROKEN_SCANF */
  +-    server_list[parsing_server_index].attempting_to_connect--;
  ++    server_list[parsing_server_index].attempting_to_connect = 0;
  +     set_server_motd(parsing_server_index, 1);
  +     server_is_connected(parsing_server_index, 1);
  +     if ((s = my_index(server, '[')) != NULL)
  +--- ircii-20021103/source/notify.c   Thu Aug 29 12:26:41 2002
  ++++ ircii-20030315/source/notify.c   Thu Mar 13 12:34:27 2003
  +@@ -228,8 +228,8 @@
  +             if (count >= location && count < location + 40)
  +             {
  +                     c2++;
  +-                    my_strcat(buf, " ");
  +-                    my_strcat(buf, tmp->nick);
  ++                    my_strmcat(buf, " ", BIG_BUFFER_SIZE);
  ++                    my_strmcat(buf, tmp->nick, BIG_BUFFER_SIZE);
  +             }
  +     }
  +     if (c2)
  +--- ircii-20021103/source/numbers.c  Sat Sep  7 09:19:45 2002
  ++++ ircii-20030315/source/numbers.c  Thu Mar 13 12:34:28 2003
  +@@ -307,7 +277,7 @@
  +             **ArgList;
  + {
  +     u_char  *chan;
  +-    u_char  buffer[BIG_BUFFER_SIZE];
  ++    u_char  buffer[BIG_BUFFER_SIZE + 1];
  + 
  +     if (ArgList[0])
  +             chan = ArgList[0];
  +@@ -322,23 +292,23 @@
  + 
  +     PasteArgs(ArgList, 0);
  +     if (do_hook(current_numeric, "%s %s", from, *ArgList)) {
  +-            my_strcpy(buffer, ArgList[0]);
  ++            my_strmcpy(buffer, ArgList[0], BIG_BUFFER_SIZE);
  +             switch(-current_numeric)
  +             {
  +             case 471:
  +-                    my_strcat(buffer, " (Channel is full)");
  ++                    my_strmcat(buffer, " (Channel is full)", BIG_BUFFER_SIZE);
  +                     break;
  +             case 473:
  +-                    my_strcat(buffer, " (Invite only channel)");
  ++                    my_strmcat(buffer, " (Invite only channel)", BIG_BUFFER_SIZE);
  +                     break;
  +             case 474:
  +-                    my_strcat(buffer, " (Banned from channel)");
  ++                    my_strmcat(buffer, " (Banned from channel)", BIG_BUFFER_SIZE);
  +                     break;
  +             case 475:
  +-                    my_strcat(buffer, " (Bad channel key)");
  ++                    my_strmcat(buffer, " (Bad channel key)", BIG_BUFFER_SIZE);
  +                     break;
  +             case 476:
  +-                    my_strcat(buffer, " (Bad channel mask)");
  ++                    my_strmcat(buffer, " (Bad channel mask)", BIG_BUFFER_SIZE);
  +                     break;
  +             }
  +             put_it("%s %s", numeric_banner(), buffer);
  +--- ircii-20021103/source/server.c   Fri Sep  6 18:04:38 2002
  ++++ ircii-20030315/source/server.c   Thu Mar 13 12:34:28 2003
  +@@ -2299,14 +2284,14 @@
  + {
  +     int     i;
  +     u_char  *value = (u_char *) 0;
  +-    u_char  buffer[BIG_BUFFER_SIZE];
  ++    u_char  buffer[BIG_BUFFER_SIZE+1];
  + 
  +     *buffer = '\0';
  +     for (i = 0; i < number_of_servers; i++)
  +             if (server_list[i].read != -1)
  +             {
  +-                    my_strcat(buffer, get_server_itsname(i));
  +-                    my_strcat(buffer, " ");
  ++                    my_strmcat(buffer, get_server_itsname(i), BIG_BUFFER_SIZE);
  ++                    my_strmcat(buffer, " ", BIG_BUFFER_SIZE);
  +             }
  +     malloc_strcpy(&value, buffer);
  + 
  +--- ircii-20021103/source/status.c   Sat Oct 12 14:41:43 2002
  ++++ ircii-20030315/source/status.c   Sat Mar 15 06:26:46 2003
  +@@ -81,6 +81,7 @@
  + static      void    status_make_printable _((u_char *, int));
  + static      void    alarm_switch _((int));
  + static      u_char  *convert_sub_format _((u_char *, int));
  ++static      void    make_status_one _((Window *, int, int));
  + 
  + /*
  +  * Maximum number of "%" expressions in a status line format.  If you change
  +@@ -671,12 +672,7 @@
  + make_status(window)
  +     Window  *window;
  + {
  +-    int     i, len, k, l,
  +-            RJustifyPos = -1,
  +-            RealPosition;
  +-    u_char  lbuf[BIG_BUFFER_SIZE + 1];
  +-    u_char  *func_value[MAX_FUNCTIONS];
  +-    int     final;
  ++    int     k, l, final;
  + 
  +     switch (window->double_status) {
  +     case -1:
  +@@ -704,143 +700,155 @@
  +                     l = 0;
  +                     
  +             if (!dumb && status_format[l])
  ++                    make_status_one(window, k, l);
  ++    }
  ++out:
  ++    cursor_to_input();
  ++}
  ++
  ++static      void
  ++make_status_one(window, k, l)
  ++    Window  *window;
  ++    int     k;
  ++    int     l;
  ++{
  ++    u_char  lbuf[BIG_BUFFER_SIZE + 1];
  ++    u_char  *func_value[MAX_FUNCTIONS];
  ++    size_t  len;
  ++    int     i,
  ++            RJustifyPos = -1,
  ++            RealPosition;
  ++
  ++    /*
  ++     * XXX: note that this code below depends on the definition
  ++     * of MAX_FUNCTIONS (currently 33), and the snprintf must
  ++     * be updated if MAX_FUNCTIONS is changed.
  ++     */
  ++    for (i = 0; i < MAX_FUNCTIONS; i++)
  ++            func_value[i] = (status_func[l][i]) (window);
  ++    lbuf[0] = REV_TOG;
  ++    snprintf(CP(lbuf+1), sizeof(lbuf) - 1, CP(status_format[l]),
  ++            func_value[0], func_value[1], func_value[2],
  ++            func_value[3], func_value[4], func_value[5],
  ++            func_value[6], func_value[7], func_value[8],
  ++            func_value[9], func_value[10], func_value[11],
  ++            func_value[12], func_value[13], func_value[14],
  ++            func_value[15], func_value[16], func_value[17],
  ++            func_value[18], func_value[19], func_value[20],
  ++            func_value[21], func_value[22], func_value[23],
  ++            func_value[24], func_value[25], func_value[26],
  ++            func_value[27], func_value[28], func_value[29],
  ++            func_value[30], func_value[31], func_value[32]);
  ++    for (i = 0; i < MAX_FUNCTIONS; i++)
  ++            new_free(&(func_value[i]));
  ++    
  ++    /*  Patched 26-Mar-93 by Aiken
  ++     *  make_window now right-justifies everything 
  ++     *  after a %>
  ++     *  it's also more efficient.
  ++     */
  ++    
  ++    RealPosition = 0;
  ++    RJustifyPos = -1;
  ++    for (i = 0; lbuf[i]; i++)
  ++            /* formfeed is a marker for left/right border*/
  ++            if (lbuf[i] == '\f')
  ++                    RJustifyPos = i;
  ++            else if (lbuf[i] != REV_TOG
  ++                     && lbuf[i] != UND_TOG 
  ++                     && lbuf[i] != ALL_OFF 
  ++                     && lbuf[i] != BOLD_TOG)
  +             {
  +-                    /*
  +-                     * XXX: note that this code below depends on the definition
  +-                     * of MAX_FUNCTIONS (currently 33), and the snprintf must
  +-                     * be updated if MAX_FUNCTIONS is changed.
  +-                     */
  +-                    for (i = 0; i < MAX_FUNCTIONS; i++)
  +-                            func_value[i] = (status_func[l][i]) (window);
  +-                    lbuf[0] = REV_TOG;
  +-                    snprintf(CP(lbuf+1), sizeof(lbuf) - 1, CP(status_format[l]),
  +-                            func_value[0], func_value[1], func_value[2],
  +-                            func_value[3], func_value[4], func_value[5],
  +-                            func_value[6], func_value[7], func_value[8],
  +-                            func_value[9], func_value[10], func_value[11],
  +-                            func_value[12], func_value[13], func_value[14],
  +-                            func_value[15], func_value[16], func_value[17],
  +-                            func_value[18], func_value[19], func_value[20],
  +-                            func_value[21], func_value[22], func_value[23],
  +-                            func_value[24], func_value[25], func_value[26],
  +-                            func_value[27], func_value[28], func_value[29],
  +-                            func_value[30], func_value[31],func_value[32]);
  +-                    for (i = 0; i < MAX_FUNCTIONS; i++)
  +-                            new_free(&(func_value[i]));
  +-                    
  +-                    /*  Patched 26-Mar-93 by Aiken
  +-                     *  make_window now right-justifies everything 
  +-                     *  after a %>
  +-                     *  it's also more efficient.
  +-                     */
  +-                    
  +-                    RealPosition = 0;
  +-                    RJustifyPos = -1;
  +-                    for (i = 0; lbuf[i]; i++)
  +-                            /* formfeed is a marker for left/right border*/
  +-                            if (lbuf[i] == '\f')
  +-                            {
  +-                                    RJustifyPos = i;
  +-                            }
  +-                            else if (lbuf[i] != REV_TOG
  +-                                     && lbuf[i] != UND_TOG 
  +-                                     && lbuf[i] != ALL_OFF 
  +-                                     && lbuf[i] != BOLD_TOG)
  +-                            {
  +-                                    if (RealPosition == current_screen->co)
  +-                                    {
  +-                                            lbuf[i] = '\0';
  +-                                            break;
  +-                                    }
  +-                                    RealPosition++;
  +-                            }
  +-                    
  +-                    /* note that i points to the nul, 
  +-                       RealPosition is vis.chars */
  +-                    
  +-                    if (RJustifyPos == -1)
  +-                    {
  +-                            RJustifyPos = i;
  +-                    }
  +-                    else
  ++                    if (RealPosition == current_screen->co)
  +                     {
  +-                            /* get rid of the marker */
  +-                            my_strcpy(&lbuf[RJustifyPos], 
  +-                                    &lbuf[RJustifyPos+1]);
  +-                            i--;
  +-                    }
  +-                    
  +-                    if (get_int_var(FULL_STATUS_LINE_VAR))
  +-                    {
  +-                            int     diff;
  +-                            u_char  c;
  +-                            
  +-                            if (RJustifyPos == 0)
  +-                                    c = ' ';
  +-                            else
  +-                                    c = lbuf[RJustifyPos - 1];
  +-                            
  +-                            diff = current_screen->co - RealPosition;
  +-                            
  +-                            for ( ; i >= RJustifyPos; i--)
  +-                                    lbuf[i + diff] = lbuf[i];
  +-                            
  +-                            for (i++ ; diff > 0 ; diff--, i++)
  +-                                    lbuf[i] = c;
  ++                            lbuf[i] = '\0';
  ++                            break;
  +                     }
  ++                    RealPosition++;
  ++            }
  ++    
  ++    /* note that i points to the nul, RealPosition is vis.chars */
  ++    if (RJustifyPos == -1)
  ++            RJustifyPos = i;
  ++    else
  ++    {
  ++            /* get rid of the marker */
  ++            my_strcpy(&lbuf[RJustifyPos], 
  ++                    &lbuf[RJustifyPos+1]);
  ++            i--;
  ++    }
  ++            
  ++    /* don't adjust the status bar if it is full already */
  ++    if (RealPosition < current_screen->co)
  ++    {
  ++            if (get_int_var(FULL_STATUS_LINE_VAR))
  ++            {
  ++                    int     diff;
  ++                    u_char  c;
  +                     
  +-                    len = my_strlen(lbuf);
  +-                    lbuf[len] = ALL_OFF;
  +-                    lbuf[len+1] =  '\0';
  ++                    if (RJustifyPos == 0)
  ++                            c = ' ';
  ++                    else
  ++                            c = lbuf[RJustifyPos - 1];
  +                     
  +-                    status_make_printable(lbuf, len);
  ++                    /*
  ++                     * does this work when the right justified position
  ++                     * has non-printable characters (eg UNG_TOG)?
  ++                     */
  ++                    diff = current_screen->co - RealPosition;
  +                     
  +-          /*
  +-           * Thanks to Max Bell ([EMAIL PROTECTED]) for info about TVI
  +-           * terminals and the sg terminal capability 
  +-           */
  +-                    RealPosition = 0;
  +-                    if (window->status_line[k] && (SG == -1))
  +-                    {
  +-                            for (i = 0; lbuf[i] && window->status_line[k][i]; i++)
  +-                            {
  +-                                    if ((u_char) lbuf[i] != 
window->status_line[k][i])
  +-                                            break;
  +-                                    if (lbuf[i] != REV_TOG 
  +-                                        && lbuf[i] != UND_TOG
  +-                                        && lbuf[i] != ALL_OFF
  +-                                        && lbuf[i] != BOLD_TOG)
  +-                                            RealPosition++;
  +-                            }
  +-                    }
  +-                    else
  +-                            i = 0;
  ++                    for ( ; i >= RJustifyPos; i--)
  ++                            lbuf[i + diff] = lbuf[i];
  +                     
  +-                    if ((len = my_strlen(lbuf + i)) 
  +-                         || lbuf[i] || window->status_line[k] 
  +-                         || window->status_line[k][i])
  +-                    {
  +-                            Screen *old_current_screen;
  +-                            
  +-                            old_current_screen = current_screen;
  +-                            set_current_screen(window->screen);
  +-                            term_move_cursor(RealPosition, window->bottom
  +-                                             + k);
  +-/*
  +-                            term_move_cursor(RealPosition, window->bottom
  +-                                             + k - window->double_status);
  +-*/
  +-                            output_line(lbuf, NULL, i);
  +-                            cursor_in_display();
  +-                            if (term_clear_to_eol())
  +-                                    term_space_erase(len);
  +-                            malloc_strcpy(&window->status_line[k], lbuf);
  +-                            set_current_screen(old_current_screen);
  +-                    }
  ++                    for (i++ ; diff > 0 ; diff--, i++)
  ++                            lbuf[i] = c;
  +             }
  +     }
  +-out:
  +-    cursor_to_input();
  ++    
  ++    len = my_strlen(lbuf);
  ++    if (len > (BIG_BUFFER_SIZE - 1))
  ++            len = BIG_BUFFER_SIZE - 1;
  ++    lbuf[len] = ALL_OFF;
  ++    lbuf[len+1] =  '\0';
  ++    
  ++    status_make_printable(lbuf, len);
  ++    
  ++    /*
  ++     * Thanks to Max Bell ([EMAIL PROTECTED]) for info
  ++     * about TVI terminals and the sg terminal capability 
  ++     */
  ++    RealPosition = 0;
  ++    if (window->status_line[k] && (SG == -1))
  ++    {
  ++            for (i = 0; lbuf[i] && window->status_line[k][i]; i++)
  ++            {
  ++                    if ((u_char) lbuf[i] != window->status_line[k][i])
  ++                            break;
  ++                    if (lbuf[i] != REV_TOG 
  ++                        && lbuf[i] != UND_TOG
  ++                        && lbuf[i] != ALL_OFF
  ++                        && lbuf[i] != BOLD_TOG)
  ++                            RealPosition++;
  ++            }
  ++    }
  ++    else
  ++            i = 0;
  ++    
  ++    if ((len = my_strlen(lbuf + i)) || lbuf[i] ||
  ++        window->status_line[k] || window->status_line[k][i])
  ++    {
  ++            Screen *old_current_screen;
  ++            
  ++            old_current_screen = current_screen;
  ++            set_current_screen(window->screen);
  ++            term_move_cursor(RealPosition, window->bottom + k);
  ++            output_line(lbuf, NULL, i);
  ++            cursor_in_display();
  ++            if (term_clear_to_eol())
  ++                    term_space_erase(len);
  ++            malloc_strcpy(&window->status_line[k], lbuf);
  ++            set_current_screen(old_current_screen);
  ++    }
  + }
  + 
  + static      u_char  *
  +@@ -1429,7 +1437,8 @@
  +             return;
  + 
  +     bzero(lbuf, BIG_BUFFER_SIZE);
  +-    for (pos = 0, s = str; s && pos < BIG_BUFFER_SIZE && pos < n; s++)
  ++    /* there can be 4 more chars stuff in: REV *s REV \0 */
  ++    for (pos = 0, s = str; s && pos < (BIG_BUFFER_SIZE - 4) && n--; s++)
  +     {
  +             so = 0;
  +             if (translation)
  +--- ircii-20021103/source/whois.c    Tue Sep  3 04:39:31 2002
  ++++ ircii-20030315/source/whois.c    Thu Mar 13 12:34:28 2003
  +@@ -1309,11 +1309,11 @@
  + {
  +     u_char  args[BIG_BUFFER_SIZE + 1];
  + 
  +-    my_strcpy(args, stuff->nick ? stuff->nick : empty_string);
  +-    my_strcat(args, stuff->oper ? " + " : " - ");
  +-    my_strcat(args, stuff->away ? "+ " : "- ");
  +-    my_strcat(args, stuff->user ? stuff->user : empty_string);
  +-    my_strcat(args, " ");
  +-    my_strcat(args, stuff->host ? stuff->host : empty_string);
  ++    my_strmcpy(args, stuff->nick ? stuff->nick : empty_string, BIG_BUFFER_SIZE);
  ++    my_strmcat(args, stuff->oper ? " + " : " - ", BIG_BUFFER_SIZE);
  ++    my_strmcat(args, stuff->away ? "+ " : "- ", BIG_BUFFER_SIZE);
  ++    my_strmcat(args, stuff->user ? stuff->user : empty_string, BIG_BUFFER_SIZE);
  ++    my_strmcat(args, " ", BIG_BUFFER_SIZE);
  ++    my_strmcat(args, stuff->host ? stuff->host : empty_string, BIG_BUFFER_SIZE);
  +     parse_line((u_char *) 0, text, args, 0, 0, 1);
  + }
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/ircii/ircii.spec
  ============================================================================
  $ cvs diff -u -r1.32.2.1.2.1 -r1.32.2.1.2.2 ircii.spec
  --- openpkg-src/ircii/ircii.spec      18 Jan 2003 17:20:15 -0000      1.32.2.1.2.1
  +++ openpkg-src/ircii/ircii.spec      19 Mar 2003 13:57:05 -0000      1.32.2.1.2.2
  @@ -33,10 +33,11 @@
   Group:        Network
   License:      BSD
   Version:      20021103
  -Release:      1.2.0
  +Release:      1.2.1
   
   #   list of sources
   Source0:      ftp://ircii.warped.com/pub/ircII/ircii-%{version}.tar.gz
  +Patch0:       ircii.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -51,6 +52,7 @@
   
   %prep
       %setup -q
  +    %patch -p1
   
   %build
       libs=""
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to