mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-05-28 16:21:27 +03:00
Merge pull request #6827 from daverodgman/mbedtls-2.28
Backport 2.28 - fix gettimeofday overflow
This commit is contained in:
commit
97a85fe110
4
ChangeLog.d/fix-gettimeofday-overflow.txt
Normal file
4
ChangeLog.d/fix-gettimeofday-overflow.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Bugfix
|
||||
* Fix possible integer overflow in mbedtls_timing_hardclock(), which
|
||||
could cause a crash for certain platforms & compiler options.
|
||||
|
@ -223,7 +223,7 @@ unsigned long mbedtls_timing_hardclock( void )
|
||||
}
|
||||
|
||||
gettimeofday( &tv_cur, NULL );
|
||||
return( ( tv_cur.tv_sec - tv_init.tv_sec ) * 1000000
|
||||
return( ( tv_cur.tv_sec - tv_init.tv_sec ) * 1000000U
|
||||
+ ( tv_cur.tv_usec - tv_init.tv_usec ) );
|
||||
}
|
||||
#endif /* !HAVE_HARDCLOCK */
|
||||
|
Loading…
x
Reference in New Issue
Block a user