summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-06-10 16:15:48 +0200
committerMS <ms@taler.net>2020-06-10 16:15:48 +0200
commitab1fc20a450d57db3d76f04ab6176ee1ff0e59b1 (patch)
tree203552f9e365f0ccba14d6fdbeb0fa53bac47aa3
parent3d1dc57bd8629b70fbe738db69caa785a47d610f (diff)
downloadexchange-ab1fc20a450d57db3d76f04ab6176ee1ff0e59b1.tar.gz
exchange-ab1fc20a450d57db3d76f04ab6176ee1ff0e59b1.tar.bz2
exchange-ab1fc20a450d57db3d76f04ab6176ee1ff0e59b1.zip
avoid assert() upon malformed IBANs
-rw-r--r--src/json/json_wire.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/json/json_wire.c b/src/json/json_wire.c
index 1cd3fd7d5..fc3d67a81 100644
--- a/src/json/json_wire.c
+++ b/src/json/json_wire.c
@@ -281,7 +281,15 @@ validate_iban (const char *iban)
j++;
}
for (j = 0; '\0' != nbuf[j]; j++)
- GNUNET_assert (isdigit ( (unsigned char) nbuf[j]));
+ {
+ if (! isdigit ( (unsigned char) nbuf[j]))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "IBAN `%s' didn't convert to numeric format\n",
+ iban);
+ return GNUNET_NO;
+ }
+ }
GNUNET_assert (sizeof(dividend) >= 8);
remainder = 0;
for (unsigned int i = 0; i<j; i += 16)