summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@mit.edu>2012-06-29 04:28:46 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2012-06-29 11:39:11 (GMT)
commit638b596992feabc7cb8a74a788b9426e4e2e95a3 (patch)
tree38d4ddaec68b16bb40810d7096fa3c7742b0a034
parent028d50d6f99e647a325a0a68303016382c4bbdc9 (diff)
downloadmonitoring-plugins-638b596992feabc7cb8a74a788b9426e4e2e95a3.tar.gz
check_smtp: Fix strcat overflows
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
-rw-r--r--plugins/check_smtp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 6b3f9dd..2a60cf0 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -366,8 +366,7 @@ main (int argc, char **argv)
366 366
367 /* encode authuser with base64 */ 367 /* encode authuser with base64 */
368 base64_encode_alloc (authuser, strlen(authuser), &abuf); 368 base64_encode_alloc (authuser, strlen(authuser), &abuf);
369 /* FIXME: abuf shouldn't have enough space to strcat a '\r\n' into it. */ 369 xasprintf(&abuf, "%s\r\n", abuf);
370 strcat (abuf, "\r\n");
371 my_send(abuf, strlen(abuf)); 370 my_send(abuf, strlen(abuf));
372 if (verbose) 371 if (verbose)
373 printf (_("sent %s\n"), abuf); 372 printf (_("sent %s\n"), abuf);
@@ -387,8 +386,7 @@ main (int argc, char **argv)
387 } 386 }
388 /* encode authpass with base64 */ 387 /* encode authpass with base64 */
389 base64_encode_alloc (authpass, strlen(authpass), &abuf); 388 base64_encode_alloc (authpass, strlen(authpass), &abuf);
390 /* FIXME: abuf shouldn't have enough space to strcat a '\r\n' into it. */ 389 xasprintf(&abuf, "%s\r\n", abuf);
391 strcat (abuf, "\r\n");
392 my_send(abuf, strlen(abuf)); 390 my_send(abuf, strlen(abuf));
393 if (verbose) { 391 if (verbose) {
394 printf (_("sent %s\n"), abuf); 392 printf (_("sent %s\n"), abuf);