summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-23 12:02:52 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-23 12:02:52 +0200
commitc79a95c7d22f7cd566275057fd38135eac6b683b (patch)
tree47bc257f42794c0dec96eb3eaa2e6fb24de5b695 /src
parent0774fd7020a4f70beb13ddf668686c44f8ebb84c (diff)
downloadexchange-c79a95c7d22f7cd566275057fd38135eac6b683b.tar.gz
exchange-c79a95c7d22f7cd566275057fd38135eac6b683b.tar.bz2
exchange-c79a95c7d22f7cd566275057fd38135eac6b683b.zip
write overflow check nicer (#6215)
Diffstat (limited to 'src')
-rw-r--r--src/util/amount.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/amount.c b/src/util/amount.c
index 2de93762..3d838b4c 100644
--- a/src/util/amount.c
+++ b/src/util/amount.c
@@ -126,7 +126,8 @@ TALER_string_to_amount (const char *str,
return GNUNET_SYSERR;
}
n = *value - '0';
- if ( (amount->value * 10 + n < amount->value) ||
+ if ( (amount->value * 10 < amount->value) ||
+ (amount->value * 10 + n < amount->value) ||
(amount->value > MAX_AMOUNT_VALUE) )
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,