summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2014-06-10 16:43:46 +0000
committergilles <gilles@openbsd.org>2014-06-10 16:43:46 +0000
commitd01778299e32c582b7dedcdfe71c8d18cbbc97ad (patch)
treed23dc200abb46e2260597753deb8d35d8cfc0b38
parentstick with 16k buffers for a little while to avoid bufferbloat. (diff)
downloadwireguard-openbsd-d01778299e32c582b7dedcdfe71c8d18cbbc97ad.tar.xz
wireguard-openbsd-d01778299e32c582b7dedcdfe71c8d18cbbc97ad.zip
we should really zero a buffer we strlcat to otherwise aliases resolution
really resolves nothing :-)
-rw-r--r--usr.sbin/smtpd/table_ldap.c3
-rw-r--r--usr.sbin/smtpd/table_sqlite.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/table_ldap.c b/usr.sbin/smtpd/table_ldap.c
index 2b3dc367ef8..d0681f9e2d5 100644
--- a/usr.sbin/smtpd/table_ldap.c
+++ b/usr.sbin/smtpd/table_ldap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_ldap.c,v 1.9 2014/03/08 15:57:31 eric Exp $ */
+/* $OpenBSD: table_ldap.c,v 1.10 2014/06/10 16:43:46 gilles Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -514,6 +514,7 @@ ldap_run_query(int type, const char *key, char *dst, size_t sz)
switch (type) {
case K_ALIAS:
+ memset(dst, 0, sz);
for (i = 0; res[0][i]; i++) {
if (i && strlcat(dst, ", ", sz) >= sz) {
ret = -1;
diff --git a/usr.sbin/smtpd/table_sqlite.c b/usr.sbin/smtpd/table_sqlite.c
index 498ac26a5cc..9e8bb08ea36 100644
--- a/usr.sbin/smtpd/table_sqlite.c
+++ b/usr.sbin/smtpd/table_sqlite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_sqlite.c,v 1.11 2013/12/26 17:25:32 eric Exp $ */
+/* $OpenBSD: table_sqlite.c,v 1.12 2014/06/10 16:43:46 gilles Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -420,6 +420,7 @@ table_sqlite_lookup(int service, const char *key, char *dst, size_t sz)
switch(service) {
case K_ALIAS:
+ memset(dst, 0, sz);
do {
value = sqlite3_column_text(stmt, 0);
if (dst[0] && strlcat(dst, ", ", sz) >= sz) {