Changeset 4bf4ce2 in mod_gnutls for src/gnutls_ocsp.c
- Timestamp:
- Jun 5, 2016, 3:42:32 PM (5 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, master, proxy-ticket, upstream
- Children:
- 368e581
- Parents:
- 6b4136c
- git-author:
- Thomas Klute <thomas2.klute@…> (06/05/16 08:50:28)
- git-committer:
- Thomas Klute <thomas2.klute@…> (06/05/16 15:42:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_ocsp.c
r6b4136c r4bf4ce2 226 226 unsigned char * fp = apr_palloc(p, fplen); 227 227 gnutls_x509_crt_get_fingerprint(cert, GNUTLS_DIG_SHA1, fp, &fplen); 228 // TODO: Prevent overflow 229 fingerprint.size = fplen; 230 fingerprint.data = fp; 228 /* Safe integer type conversion: The types of fingerprint.size 229 * (unsigned int) and fplen (size_t) may have different 230 * lengths. */ 231 if (__builtin_add_overflow(fplen, 0, &fingerprint.size)) 232 fingerprint.size = 0; 233 else 234 fingerprint.data = fp; 231 235 return fingerprint; 232 236 } … … 284 288 } 285 289 apr_file_close(file); 286 // TODO: Prevent overflow 287 resp.size = br; 288 290 /* safe integer type conversion */ 291 if (__builtin_add_overflow(br, 0, &resp.size)) 292 { 293 apr_pool_destroy(tmp); 294 return APR_EINVAL; 295 } 289 296 290 297 /* TODO: make cache lifetime configurable */
Note: See TracChangeset
for help on using the changeset viewer.