From: Slaven Rezic Date: Sun, 19 Oct 2003 17:54:59 +0000 (+0200) Subject: Re: [perl #24225] [5.8.1] segfault in binmode STDOUT, ':stdio'; print 1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a0625d383a69c2c6fd20da94ef6df644cb75b45b;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #24225] [5.8.1] segfault in binmode STDOUT, ':stdio'; print 1 Message-ID: <871xt9te7g.fsf@vran.herceg.de> p4raw-id: //depot/perl@21505 --- diff --git a/perlio.c b/perlio.c index faa3b19..c4a81af 100644 --- a/perlio.c +++ b/perlio.c @@ -2613,8 +2613,10 @@ char * PerlIOStdio_mode(const char *mode, char *tmode) { char *ret = tmode; - while (*mode) { - *tmode++ = *mode++; + if (mode) { + while (*mode) { + *tmode++ = *mode++; + } } #if defined(PERLIO_USING_CRLF) || defined(__CYGWIN__) *tmode++ = 'b';