diff options
author | dfr <dfr@FreeBSD.org> | 2008-05-07 13:39:42 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2008-05-07 13:39:42 +0000 |
commit | 51b6601db456e699ea5d4843cbc7239ee92d9c13 (patch) | |
tree | 4dbb862199a916e3ffe75f1cb08703ec0e662ffc /crypto/heimdal/appl/push/push.c | |
parent | 2565fa13487d5bfc858144e431e3dfd7ffa5200e (diff) | |
download | FreeBSD-src-51b6601db456e699ea5d4843cbc7239ee92d9c13.zip FreeBSD-src-51b6601db456e699ea5d4843cbc7239ee92d9c13.tar.gz |
Vendor import of Heimdal 1.1
Diffstat (limited to 'crypto/heimdal/appl/push/push.c')
-rw-r--r-- | crypto/heimdal/appl/push/push.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/heimdal/appl/push/push.c b/crypto/heimdal/appl/push/push.c index 2e6f8b8..87a0be2 100644 --- a/crypto/heimdal/appl/push/push.c +++ b/crypto/heimdal/appl/push/push.c @@ -32,7 +32,7 @@ */ #include "push_locl.h" -RCSID("$Id: push.c,v 1.47.2.1 2004/06/21 10:54:46 lha Exp $"); +RCSID("$Id: push.c 14850 2005-04-19 18:00:17Z lha $"); #ifdef KRB4 static int use_v4 = -1; @@ -268,11 +268,13 @@ doit(int s, now = time(NULL); from_line_length = snprintf (from_line, sizeof(from_line), "From %s %s", "push", ctime(&now)); + if (from_line_length < 0 || from_line_length > sizeof(from_line)) + errx (1, "snprintf failed"); out_len = snprintf (out_buf, sizeof(out_buf), "USER %s\r\nPASS hej\r\nSTAT\r\n", user); - if (out_len < 0) + if (out_len < 0 || out_len > sizeof(out_buf)) errx (1, "snprintf failed"); if (net_write (s, out_buf, out_len) != out_len) err (1, "write"); @@ -490,7 +492,7 @@ doit(int s, else if(state == DELE) out_len = snprintf (out_buf, sizeof(out_buf), "DELE %u\r\n", ++asked_deleted); - if (out_len < 0) + if (out_len < 0 || out_len > sizeof(out_buf)) errx (1, "snprintf failed"); if (net_write (s, out_buf, out_len) != out_len) err (1, "write"); |