Sophie

Sophie

distrib > Mandriva > 2011.0 > i586 > media > main-updates-src > by-pkgid > e0194046f2d513703713dc7654db4489 > files > 1

perl-DBD-Pg-2.18.1-1.1.src.rpm

From f014710c05e4952385c8223a47bb1fcb7b48b51a Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sat, 3 Mar 2012 21:50:32 +0200
Subject: [PATCH] Explicitly warn and croak with controlled format strings

This fixes builds with 'gcc -Werror=format-security'.
---
 dbdimp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dbdimp.c b/dbdimp.c
index c298e85..7032f79 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -328,7 +328,7 @@ static void pg_warn (void * arg, const char * message)
 						DBIc_is(imp_dbh, DBIcf_PrintWarn) ? 1 : 0);
 
 		if (DBIc_WARN(imp_dbh) && DBIc_is(imp_dbh, DBIcf_PrintWarn))
-			warn(message);
+			warn("%s", message);
 
 		if (TEND) TRC(DBILOGFP, "%sEnd pg_warn\n", THEADER);
 	}
@@ -1531,7 +1531,7 @@ int dbd_st_prepare (SV * sth, imp_sth_t * imp_sth, char * statement, SV * attrib
 
 		if (pg_st_prepare_statement(aTHX_ sth, imp_sth)!=0) {
 			TRACE_PQERRORMESSAGE;
-			croak (PQerrorMessage(imp_dbh->conn));
+			croak ("%s", PQerrorMessage(imp_dbh->conn));
 		}
 	}
 
-- 
1.7.9.1