[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] 01/02: really carefully check strtoll() re
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] 01/02: really carefully check strtoll() return value before casting to uint64_t |
Date: |
Fri, 06 Oct 2017 22:06:39 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit d86a6615cc60ba9e9d1a70146d761160564f404a
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Oct 6 22:04:51 2017 +0200
really carefully check strtoll() return value before casting to uint64_t
---
src/auditor/taler-auditor.c | 1 +
src/exchange-tools/taler-exchange-keyup.c | 12 ++++++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index bf8bd97..f9f03b0 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -1941,6 +1941,7 @@ wire_transfer_information_cb (void *cls,
return;
}
+ GNUNET_assert (NULL != dki); /* mostly to help static analysis */
/* Check transaction history to see if it supports aggregate
valuation */
check_transaction_history (coin_pub,
diff --git a/src/exchange-tools/taler-exchange-keyup.c
b/src/exchange-tools/taler-exchange-keyup.c
index facb832..ccaca14 100644
--- a/src/exchange-tools/taler-exchange-keyup.c
+++ b/src/exchange-tools/taler-exchange-keyup.c
@@ -363,18 +363,22 @@ get_anchor_iter (void *cls,
struct GNUNET_TIME_Absolute stamp;
const char *base;
char *end = NULL;
+ long long int bval;
base = GNUNET_STRINGS_get_short_name (filename);
- stamp.abs_value_us = strtoll (base,
- &end,
- 10);
- if ((NULL == end) || (0 != *end))
+ bval = strtoll (base,
+ &end,
+ 10);
+ if ( (NULL == end) ||
+ (0 != *end) ||
+ (0 > bval) )
{
fprintf(stderr,
"Ignoring unexpected file `%s'.\n",
filename);
return GNUNET_OK;
}
+ stamp.abs_value_us = (uint64_t) bval;
*anchor = GNUNET_TIME_absolute_max (stamp,
*anchor);
return GNUNET_OK;
--
To stop receiving notification emails like this one, please contact
address@hidden