RE: 4.0.2 and CAN-2003-0972

Juergen Weigert <[email protected]>
Newsgroups gmane.comp.gnu.screen
Message-ID <20040122214620.GM14810@faui40p>
>     Juergen> Wrong! 4.0.2 fixes CAN-2003-0972
> 
> So the patch in the link is not used?  I raised this issue because
> the ansi.c still have the old statements:
> 
>      --- ansi.c.old  2003-11-15 18:04:12.000000000 +0200
>      +++ ansi.c      2003-11-15 18:04:51.000000000 +0200
>      @@ -559,7 +559,7 @@
>                  {
>                  case '0': case '1': case '2': case '3': case '4':
>                  case '5': case '6': case '7': case '8': case '9':
>      -             if (curr->w_NumArgs < MAXARGS)
>      +             if (curr->w_NumArgs >= 0 && curr->w_NumArgs <
>                    MAXARGS)
>                      {
>                        if (curr->w_args[curr->w_NumArgs] < 100000000)
>                          curr->w_args[curr->w_NumArgs] =

Correct.  The above if-statement no longer matters. It is always true.
If you would do a complete diff -u screen-4.0.1/ansi.c screen-4.0.2/ansi.c, then
you see. 

--- screen-4.0.1/ansi.c 2003-09-08 16:24:44.000000000 +0200
+++ screen-4.0.2/ansi.c 2003-12-05 14:57:05.000000000 +0100
@@ -568,14 +568,16 @@
              break;
            case ';':
            case ':':
-             curr->w_NumArgs++;
+             if (curr->w_NumArgs < MAXARGS)
+               curr->w_NumArgs++;
              break;
            default:
              if (Special(c))
                break;
              if (c >= '@' && c <= '~')
                {
-                 curr->w_NumArgs++;
+                 if (curr->w_NumArgs < MAXARGS)
+                   curr->w_NumArgs++;
                  DoCSI(c, curr->w_intermediate);
                  if (curr->w_state != PRIN)
                    curr->w_state = LIT;
@@ -1230,6 +1232,8 @@
            a1 = curr->w_width;
          if (a2 < 1)
            a2 = curr->w_height;
+         if (a1 > 10000 || a2 > 10000)
+           break;
          WChangeSize(curr, a1, a2);
          cols = curr->w_width;
          rows = curr->w_height;


cheers,
        Jw.

-- 
 o \  Juergen Weigert      unix-software __/ _=======.=======_     
<V> | [email protected]         creator    __/        _---|____________\/    
 \  |            0179/2069677      __/          (____/            /\
(/) | ____________________________/              _/ \_ vim:set sw=2 wm=8

 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/gnu-screen/

To unsubscribe from this group, send an email to:
 [email protected]

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.