[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gawk-3.1.3 segfaults

From: Stepan Kasal
Subject: gawk-3.1.3 segfaults
Date: Thu, 8 Jul 2004 11:29:10 +0200
User-agent: Mutt/1.4.1i

  I've noticed an "internal error" of gawk 3.1.3.

        gawk 'BEGIN{print "date" |& getline}'

Patch below.  (Both bug and patch should apply to current code too.)

        Stepan Kasal

2004-07-08  Stepan Kasal  <address@hidden>

        Fixed a segfault triggered by the following:

                gawk 'BEGIN{print "date" |& getline}'

        No test case created, beacuse of teh following:
        Correct interpretation involves executing "1" or "0" -- as the user
        may have defined this, we would have to override this in the test
        script.  It's not worth the hassle.

        * awkgram.y (output_redir): Make sure not to dereference NULL
          pointer.  The bug was triggered by the following code:

diff -urpN gawk-3.1.3.orig/awkgram.y gawk-3.1.3/awkgram.y
--- gawk-3.1.3.orig/awkgram.y   2004-06-14 13:46:17.000000000 +0200
+++ gawk-3.1.3/awkgram.y        2004-07-08 11:02:54.000000000 +0200
@@ -677,6 +677,7 @@ output_redir
                $$ = node($3, $1, (NODE *) NULL);
                if ($1 == Node_redirect_twoway
                    && $3->type == Node_K_getline
+                   && $3->rnode != NULL
                    && $3->rnode->type == Node_redirect_twoway)
                        yyerror(_("multistage two-way pipelines don't work"));

reply via email to

[Prev in Thread] Current Thread [Next in Thread]