diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2016-07-17 15:28:09 +0200 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2016-07-20 19:25:16 +0200 |
commit | 1618679ac478c8f41fc5f320fb4d8a33883b3868 (patch) | |
tree | 226153f11e35f97136574bdaaec6ce6dc5f745ec /crypto/bio | |
parent | 69588edbaa424beb71c6a9b1be416588232cb78c (diff) |
Cast to an unsigned type before negating
llvm's ubsan reported:
runtime error: negation of -9223372036854775808 cannot be represented in type
'long'; cast to an unsigned type to negate this value to itself
Found using afl
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1325
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/b_print.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c index 6808cdc6de..a46d8b160a 100644 --- a/crypto/bio/b_print.c +++ b/crypto/bio/b_print.c @@ -451,7 +451,7 @@ fmtint(char **sbuffer, if (!(flags & DP_F_UNSIGNED)) { if (value < 0) { signvalue = '-'; - uvalue = -value; + uvalue = -(unsigned LLONG)value; } else if (flags & DP_F_PLUS) signvalue = '+'; else if (flags & DP_F_SPACE) |