openbsd-ports/mail/dspam/patches/patch-src_pgsql_drv_c

31 lines
1.4 KiB
Plaintext

$OpenBSD: patch-src_pgsql_drv_c,v 1.6 2010/10/24 12:14:08 naddy Exp $
--- src/pgsql_drv.c.orig Sat Jul 29 15:38:48 2006
+++ src/pgsql_drv.c Sun Oct 24 13:51:05 2010
@@ -1146,7 +1146,7 @@ _ds_get_signature (DSPAM_CTX * CTX, struct _ds_spam_si
p = _pgsql_drv_getpwuid (CTX, uid);
if (!p) {
- LOG(LOG_CRIT, "_ds_get_signature(): _mysql_drv_getpwuid(%d) failed: aborting", uid);
+ LOG(LOG_CRIT, "_ds_get_signature(): _pgsql_drv_getpwuid(%d) failed: aborting", uid);
return EFAILURE;
}
username = strdup(p->pw_name);
@@ -1241,7 +1241,7 @@ _ds_set_signature (DSPAM_CTX * CTX, struct _ds_spam_si
mem = PQescapeBytea(SIG->data, SIG->length, &length);
snprintf (scratch, sizeof (scratch),
- "INSERT INTO dspam_signature_data (uid, signature, length, created_on, data) VALUES (%d, '%s', %ld, CURRENT_DATE, '",
+ "INSERT INTO dspam_signature_data (uid, signature, length, created_on, data) VALUES (%d, '%s', %ld, CURRENT_DATE, E'",
(int)p->pw_uid, signature, SIG->length);
buffer_cat (query, scratch);
buffer_cat (query, (const char *) mem);
@@ -1405,7 +1405,7 @@ _ds_get_nextuser (DSPAM_CTX * CTX)
virtual_username,
virtual_table);
#else
- strcpy (query, "DECLARE dscursor CURSOR FOR SELECT DISTINCT uid FROM dspam_stats");
+ strlcpy (query, "DECLARE dscursor CURSOR FOR SELECT DISTINCT uid FROM dspam_stats", sizeof (query));
#endif
result = PQexec(s->dbh, query);