diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-12-13 16:38:17 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-12-13 16:38:17 +0100 |
commit | ceab7011c2af9d86bd7743d6c1b7c37540fe14f1 (patch) | |
tree | d74abdd79993991ee8bd96c0c5fd614162666312 /MANIFEST | |
parent | 71446f2da4f4887cb6b60b4ddee4754faee70d3d (diff) | |
download | perl-ceab7011c2af9d86bd7743d6c1b7c37540fe14f1.tar.gz |
GDBM_File is meant to croak() if the gdbm library has a fatal error.
gdbm_open() takes a fifth argument, for an optional callback function used
to report a fatal error. Since it was added in 5.000, the tied hash wrapper
implemented in GDBM_File.xs has (intended) to default this to croak().
However, the callback expects a function taking a single const char *
argument, whereas croak(const char *pat, ...) has variable arguments.
The code as-was had two bugs
1) The calling ABI on some platforms differs between a (known) variable-
argument function, and one which takes (known) fixed arguments. As the
call site knows the pointer is to a function with fixed arguments, the
calling convention it uses doesn't match what Perl_croak_nocontext()
expects, which can lead to crashes.
2) A message containing % characters will be interpreted as a printf format.
Both these are fixed by using a small station function as a wrapper, which
takes a single string argument, and passes to croak() a "%s" format string,
followed by the string for the error message.
Add a test for this functionality.
Diffstat (limited to 'MANIFEST')
-rw-r--r-- | MANIFEST | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -3761,6 +3761,7 @@ ext/GDBM_File/GDBM_File.pm GDBM extension Perl module ext/GDBM_File/GDBM_File.xs GDBM extension external subroutines ext/GDBM_File/hints/sco.pl Hint for GDBM_File for named architecture ext/GDBM_File/Makefile.PL GDBM extension makefile writer +ext/GDBM_File/t/fatal.t Test the fatal_func argument to gdbm_open ext/GDBM_File/t/gdbm.t See if GDBM_File works ext/GDBM_File/typemap GDBM extension interface types ext/Hash-Util/Changes Change history of Hash::Util |