diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-04-19 11:46:40 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-04-19 11:46:40 +0000 |
commit | 141966a22562a32180a51619ea934c0cb75be3db (patch) | |
tree | 0fa6b507c046976ea18472bfbc3dfdc767f3fedc /lib | |
parent | 439b7d633113965cd3dc8287d22f1ca5db6a67fe (diff) |
We'll interpret a (void) cast on snprintf() to mean it's been verified that
truncation is either desirable, not an issue, or is detected and handled later
ok deraadt@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/apps/apps.c | 24 | ||||
-rw-r--r-- | lib/libssl/src/apps/ca.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/apps/enc.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/apps/req.c | 12 | ||||
-rw-r--r-- | lib/libssl/src/apps/s_time.c | 6 |
5 files changed, 23 insertions, 23 deletions
diff --git a/lib/libssl/src/apps/apps.c b/lib/libssl/src/apps/apps.c index 4a8be9993df..9a731fe75bc 100644 --- a/lib/libssl/src/apps/apps.c +++ b/lib/libssl/src/apps/apps.c @@ -1449,7 +1449,7 @@ save_serial(char *serialfile, char *suffix, BIGNUM * serial, if (suffix == NULL) strlcpy(buf[0], serialfile, BSIZE); else - (void) snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix); + snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix); #ifdef RL_DEBUG BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]); #endif @@ -1495,9 +1495,9 @@ rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) BIO_printf(bio_err, "file name too long\n"); goto err; } - (void) snprintf(buf[0], sizeof buf[0], "%s.%s", + snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, new_suffix); - (void) snprintf(buf[1], sizeof buf[1], "%s.%s", + snprintf(buf[1], sizeof buf[1], "%s.%s", serialfile, old_suffix); #ifdef RL_DEBUG BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", @@ -1580,7 +1580,7 @@ load_index(char *dbfile, DB_ATTR * db_attr) if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL) goto err; - (void) snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile); + snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile); dbattr_conf = NCONF_new(NULL); if (NCONF_load(dbattr_conf, buf[0], &errorline) <= 0) { if (errorline > 0) { @@ -1661,9 +1661,9 @@ save_index(const char *dbfile, const char *suffix, CA_DB * db) BIO_printf(bio_err, "file name too long\n"); goto err; } - (void) snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile); - (void) snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix); - (void) snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix); + snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile); + snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix); + snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix); #ifdef RL_DEBUG BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]); #endif @@ -1710,14 +1710,14 @@ rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) BIO_printf(bio_err, "file name too long\n"); goto err; } - (void) snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile); - (void) snprintf(buf[2], sizeof buf[2], "%s.attr.%s", + snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile); + snprintf(buf[2], sizeof buf[2], "%s.attr.%s", dbfile, new_suffix); - (void) snprintf(buf[0], sizeof buf[0], "%s.%s", + snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, new_suffix); - (void) snprintf(buf[1], sizeof buf[1], "%s.%s", + snprintf(buf[1], sizeof buf[1], "%s.%s", dbfile, old_suffix); - (void) snprintf(buf[3], sizeof buf[3], "%s.attr.%s", + snprintf(buf[3], sizeof buf[3], "%s.attr.%s", dbfile, old_suffix); #ifdef RL_DEBUG BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", diff --git a/lib/libssl/src/apps/ca.c b/lib/libssl/src/apps/ca.c index 3f2d10671c0..c70ca5f1686 100644 --- a/lib/libssl/src/apps/ca.c +++ b/lib/libssl/src/apps/ca.c @@ -1143,7 +1143,7 @@ ca_main(int argc, char **argv) for (k = 0; k < j; k++) { if (n >= &(buf[2][sizeof(buf[2])])) break; - (void) snprintf(n, + snprintf(n, &buf[2][0] + sizeof(buf[2]) - n, "%02X", (unsigned char) *(p++)); n += 2; diff --git a/lib/libssl/src/apps/enc.c b/lib/libssl/src/apps/enc.c index 18760113c12..c8f04106ccb 100644 --- a/lib/libssl/src/apps/enc.c +++ b/lib/libssl/src/apps/enc.c @@ -388,7 +388,7 @@ enc_main(int argc, char **argv) for (;;) { char buf[200]; - (void) snprintf(buf, sizeof buf, "enter %s %s password:", + snprintf(buf, sizeof buf, "enter %s %s password:", OBJ_nid2ln(EVP_CIPHER_nid(cipher)), (enc) ? "encryption" : "decryption"); strbuf[0] = '\0'; diff --git a/lib/libssl/src/apps/req.c b/lib/libssl/src/apps/req.c index 1ed8c84a8d6..38428f856dd 100644 --- a/lib/libssl/src/apps/req.c +++ b/lib/libssl/src/apps/req.c @@ -1081,17 +1081,17 @@ start: for (;;) { ERR_clear_error(); def = ""; } - (void) snprintf(buf, sizeof buf, "%s_value", v->name); + snprintf(buf, sizeof buf, "%s_value", v->name); if ((value = NCONF_get_string(req_conf, dn_sect, buf)) == NULL) { ERR_clear_error(); value = NULL; } - (void) snprintf(buf, sizeof buf, "%s_min", v->name); + snprintf(buf, sizeof buf, "%s_min", v->name); if (!NCONF_get_number(req_conf, dn_sect, buf, &n_min)) { ERR_clear_error(); n_min = -1; } - (void) snprintf(buf, sizeof buf, "%s_max", v->name); + snprintf(buf, sizeof buf, "%s_max", v->name); if (!NCONF_get_number(req_conf, dn_sect, buf, &n_max)) { ERR_clear_error(); n_max = -1; @@ -1131,18 +1131,18 @@ start: for (;;) { ERR_clear_error(); def = ""; } - (void) snprintf(buf, sizeof buf, "%s_value", type); + snprintf(buf, sizeof buf, "%s_value", type); if ((value = NCONF_get_string(req_conf, attr_sect, buf)) == NULL) { ERR_clear_error(); value = NULL; } - (void) snprintf(buf, sizeof buf, "%s_min", type); + snprintf(buf, sizeof buf, "%s_min", type); if (!NCONF_get_number(req_conf, attr_sect, buf, &n_min)) { ERR_clear_error(); n_min = -1; } - (void) snprintf(buf, sizeof buf, "%s_max", type); + snprintf(buf, sizeof buf, "%s_max", type); if (!NCONF_get_number(req_conf, attr_sect, buf, &n_max)) { ERR_clear_error(); n_max = -1; diff --git a/lib/libssl/src/apps/s_time.c b/lib/libssl/src/apps/s_time.c index f74c9b9c7f9..e7fc7e2e07c 100644 --- a/lib/libssl/src/apps/s_time.c +++ b/lib/libssl/src/apps/s_time.c @@ -398,7 +398,7 @@ s_time_main(int argc, char **argv) goto end; if (s_www_path != NULL) { - (void) snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path); + snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path); SSL_write(scon, buf, strlen(buf)); while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) bytes_read += i; @@ -453,7 +453,7 @@ next: goto end; } if (s_www_path != NULL) { - (void) snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path); + snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path); SSL_write(scon, buf, strlen(buf)); while (SSL_read(scon, buf, sizeof(buf)) > 0); } @@ -490,7 +490,7 @@ next: goto end; if (s_www_path) { - (void) snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path); + snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path); SSL_write(scon, buf, strlen(buf)); while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) bytes_read += i; |