Changeset ef06c74 in mod_gnutls
- Timestamp:
- Jun 18, 2016, 3:18:36 PM (7 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, main, master, proxy-ticket, upstream
- Children:
- f1147b6
- Parents:
- ac3f500
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_ocsp.c
rac3f500 ref06c74 393 393 * (unsigned int) and fplen (size_t) may have different 394 394 * lengths. */ 395 #if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) 396 if (__builtin_expect(fplen <= UINT_MAX, 1)) 397 { 398 fingerprint.size = (unsigned int) fplen; 399 fingerprint.data = fp; 400 } 401 #else 395 402 if (__builtin_add_overflow(fplen, 0, &fingerprint.size)) 396 403 fingerprint.size = 0; 397 404 else 398 405 fingerprint.data = fp; 406 #endif 399 407 return fingerprint; 400 408 } … … 541 549 } 542 550 543 /* With the length restriction this really should not happen. */ 551 /* With the length restriction this really should not overflow. */ 552 #if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) 553 if (__builtin_expect(len > UINT_MAX, 0)) 554 #else 544 555 if (__builtin_add_overflow(len, 0, &response->size)) 556 #endif 545 557 { 546 558 response->data = NULL; … … 549 561 else 550 562 { 563 #if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) 564 response->size = (unsigned int) len; 565 #endif 551 566 response->data = apr_pmemdup(p, buf, len); 552 567 } -
src/gnutls_util.c
rac3f500 ref06c74 112 112 apr_file_close(file); 113 113 114 /* safe integer type conversion */ 114 /* safe integer type conversion: unsigned int and apr_size_t might 115 * have different sizes */ 116 #if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) 117 if (__builtin_expect(br > UINT_MAX, 0)) 118 return APR_EINVAL; 119 else 120 datum->size = (unsigned int) br; 121 #else 115 122 if (__builtin_add_overflow(br, 0, &datum->size)) 116 123 return APR_EINVAL; 124 #endif 117 125 118 126 return rv;
Note: See TracChangeset
for help on using the changeset viewer.