summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_strex.c
diff options
context:
space:
mode:
authorguenther <>2014-04-19 11:46:39 +0000
committerguenther <>2014-04-19 11:46:39 +0000
commit15e0442b8cfbbc095af4db97db7cd2b6d8dc23d0 (patch)
tree1c4f9b095801061d57e575e80f245cef8a59a27f /src/lib/libcrypto/asn1/a_strex.c
parentac3cb5c172d4edffffbf917c401f9b4bfecea55f (diff)
downloadopenbsd-15e0442b8cfbbc095af4db97db7cd2b6d8dc23d0.tar.gz
openbsd-15e0442b8cfbbc095af4db97db7cd2b6d8dc23d0.tar.bz2
openbsd-15e0442b8cfbbc095af4db97db7cd2b6d8dc23d0.zip
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 'src/lib/libcrypto/asn1/a_strex.c')
-rw-r--r--src/lib/libcrypto/asn1/a_strex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c
index 7dc531a2d8..e92c166303 100644
--- a/src/lib/libcrypto/asn1/a_strex.c
+++ b/src/lib/libcrypto/asn1/a_strex.c
@@ -125,12 +125,12 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch
125 if(c > 0xffffffffL) 125 if(c > 0xffffffffL)
126 return -1; 126 return -1;
127 if(c > 0xffff) { 127 if(c > 0xffff) {
128 (void) snprintf(tmphex, sizeof tmphex, "\\W%08lX", c); 128 snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
129 if(!io_ch(arg, tmphex, 10)) return -1; 129 if(!io_ch(arg, tmphex, 10)) return -1;
130 return 10; 130 return 10;
131 } 131 }
132 if(c > 0xff) { 132 if(c > 0xff) {
133 (void) snprintf(tmphex, sizeof tmphex, "\\U%04lX", c); 133 snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
134 if(!io_ch(arg, tmphex, 6)) return -1; 134 if(!io_ch(arg, tmphex, 6)) return -1;
135 return 6; 135 return 6;
136 } 136 }
@@ -149,7 +149,7 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch
149 return 2; 149 return 2;
150 } 150 }
151 if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) { 151 if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) {
152 (void) snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp); 152 snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
153 if(!io_ch(arg, tmphex, 3)) return -1; 153 if(!io_ch(arg, tmphex, 3)) return -1;
154 return 3; 154 return 3;
155 } 155 }