This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix core dump on IO::Seekable::setpos($fh, undef)
[perl5.git]
/
ext
/
IO
/
IO.xs
diff --git
a/ext/IO/IO.xs
b/ext/IO/IO.xs
index
5efbf24
..
2eb16f4
100644
(file)
--- a/
ext/IO/IO.xs
+++ b/
ext/IO/IO.xs
@@
-106,11
+106,12
@@
fsetpos(handle, pos)
InputStream handle
SV * pos
CODE:
InputStream handle
SV * pos
CODE:
- if (handle)
+ char *p;
+ if (handle && (p = SvPVx(pos, na)) && na == sizeof(Fpos_t))
#ifdef PerlIO
#ifdef PerlIO
- RETVAL = PerlIO_setpos(handle, (Fpos_t*)
SvPVX(pos)
);
+ RETVAL = PerlIO_setpos(handle, (Fpos_t*)
p
);
#else
#else
- RETVAL = fsetpos(handle, (Fpos_t*)
SvPVX(pos)
);
+ RETVAL = fsetpos(handle, (Fpos_t*)
p
);
#endif
else {
RETVAL = -1;
#endif
else {
RETVAL = -1;