diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-02-16 16:16:33 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-02-16 16:20:12 +0000 |
commit | be1cf43c8dab9dd236839206d53611f7e7d2d856 (patch) | |
tree | bfa364bbad6e8e3e86029e0df585a0e00af6174b /mg.c | |
parent | cc0193b268b34831b23946ad1ecf255c0404d836 (diff) | |
download | perl-be1cf43c8dab9dd236839206d53611f7e7d2d856.tar.gz |
Fix #72850 - reading $! shouldn't SEGV if Strerror(errno) returns NULL.
This can happen on some OSes for out of range errno values. The bug was
introduced with 0097b436152452e4, which in turn fixed #61976.
Test case by Steve Peters.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1048,7 +1048,8 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) else #endif sv_setpv(sv, errno ? Strerror(errno) : ""); - SvPOK_on(sv); /* may have got removed during taint processing */ + if (SvPOKp(sv)) + SvPOK_on(sv); /* may have got removed during taint processing */ RESTORE_ERRNO; } |