summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>2019-06-16 11:40:03 -0700
committerJunio C Hamano <gitster@pobox.com>2019-06-19 07:41:31 -0700
commit729a9b558b0408fdf60e39c96b04b33a333d8366 (patch)
treea3343ecf30fdce34eb904aafa375b0f359a94949 /builtin/commit.c
parentb697d92f56511e804b8ba20ccbe7bdc85dc66810 (diff)
wrapper: avoid undefined behaviour in macOS
0620b39b3b ("compat: add a mkstemps() compatibility function", 2009-05-31) included a function based on code from libiberty which would result in undefined behaviour in platforms where timeval's tv_usec is a 32-bit signed type as shown by: wrapper.c:505:31: runtime error: left shift of 594546 by 16 places cannot be represented in type '__darwin_suseconds_t' (aka 'int') interestingly the version of this code from gcc never had this bug and the code had a cast that would had prevented the issue (at least in 64-bit platforms) but was misapplied. change the cast to uint64_t so it also works in 32-bit platforms. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions