diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-26 11:26:35 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-26 23:23:44 +0930 |
commit | b4e125d9351f84233698bef91530743547c87403 (patch) | |
tree | 39a188813d5970328dcd00d0a141833bba0a4a0d /bfd/vms-misc.c | |
parent | a68aba2da76e802faf2ea887a9d8ff16d3d5959f (diff) | |
download | binutils-b4e125d9351f84233698bef91530743547c87403.zip binutils-b4e125d9351f84233698bef91530743547c87403.tar.gz binutils-b4e125d9351f84233698bef91530743547c87403.tar.bz2 |
PR26415 UBSAN: vms-misc.c:636 left shift cannot be represented
An unsigned short value is promoted to int, thus triggering UB on a
left shift of a positive value that results in a negative int.
PR 26415
* vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
Diffstat (limited to 'bfd/vms-misc.c')
-rw-r--r-- | bfd/vms-misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c index d040c79..0826456 100644 --- a/bfd/vms-misc.c +++ b/bfd/vms-misc.c @@ -592,8 +592,8 @@ vms_time_to_time_t (unsigned int hi, unsigned int lo) void vms_time_t_to_vms_time (time_t ut, unsigned int *hi, unsigned int *lo) { - unsigned short val[4]; - unsigned short tmp[4]; + unsigned int val[4]; + unsigned int tmp[4]; unsigned int carry; int i; |