|
| 1 | +From bfe5d73c162d2d1f761a639a0aa33aad6a9eb54e Mon Sep 17 00:00:00 2001 |
| 2 | +From: "H.Merijn Brand - Tux" <linux@tux.freedom.nl> |
| 3 | +Date: Wed, 27 May 2026 11:16:50 +0200 |
| 4 | +Subject: [PATCH] Fix possible stack overflow (old issue already noted by Tim) |
| 5 | + |
| 6 | +Upstream-reference: https://github.com/perl5-dbi/dbi/commit/bfe5d73c162d2d1f761a639a0aa33aad6a9eb54e.patch |
| 7 | +https://sources.debian.org/src/libdbi-perl/1.643-4%2Bdeb12u1/debian/patches/Fix-possible-stack-overflow-old-issue-already-noted-.patch |
| 8 | +--- |
| 9 | + DBI.xs | 7 ++----- |
| 10 | + 1 file changed, 2 insertions(+), 5 deletions(-) |
| 11 | + |
| 12 | +diff --git a/DBI.xs b/DBI.xs |
| 13 | +index 01a543b..8858e21 100644 |
| 14 | +--- a/DBI.xs |
| 15 | ++++ b/DBI.xs |
| 16 | +@@ -3998,7 +3998,6 @@ XS(XS_DBI_dispatch) |
| 17 | + SV **statement_svp = NULL; |
| 18 | + const int is_warning = (!SvTRUE(err_sv) && strlen(SvPV_nolen(err_sv))==1); |
| 19 | + const char *err_meth_name = meth_name; |
| 20 | +- char intro[200]; |
| 21 | + |
| 22 | + if (meth_type == methtype_set_err) { |
| 23 | + SV **sem_svp = hv_fetch((HV*)SvRV(h), "dbi_set_err_method", 18, GV_ADDWARN); |
| 24 | +@@ -4006,10 +4005,8 @@ XS(XS_DBI_dispatch) |
| 25 | + err_meth_name = SvPV_nolen(*sem_svp); |
| 26 | + } |
| 27 | + |
| 28 | +- /* XXX change to vsprintf into sv directly */ |
| 29 | +- sprintf(intro,"%s %s %s: ", HvNAME(DBIc_IMP_STASH(imp_xxh)), err_meth_name, |
| 30 | +- SvTRUE(err_sv) ? "failed" : is_warning ? "warning" : "information"); |
| 31 | +- msg = sv_2mortal(newSVpv(intro,0)); |
| 32 | ++ msg = sv_2mortal(newSVpvf("%s %s %s: ", HvNAME(DBIc_IMP_STASH(imp_xxh)), err_meth_name, |
| 33 | ++ SvTRUE(err_sv) ? "failed" : is_warning ? "warning" : "information")); |
| 34 | + if (SvOK(DBIc_ERRSTR(imp_xxh))) |
| 35 | + sv_catsv(msg, DBIc_ERRSTR(imp_xxh)); |
| 36 | + else |
| 37 | +-- |
| 38 | +2.45.4 |
| 39 | + |
0 commit comments