aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-08 22:47:57 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-08 22:47:57 +0100
commit45a7b98d4b06489310691e9a47d3f2c5b2bc450e (patch)
tree76aab08005c865fdb48058d02e7a5accb66563ac
parentb19c7cff91704cbbd6355b60beaacea983a1f02b (diff)
handle missconfiguration more nicely
-rw-r--r--src/exchange/taler-exchange-httpd_terms.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_terms.c b/src/exchange/taler-exchange-httpd_terms.c
index 8c25e5383..e475a0269 100644
--- a/src/exchange/taler-exchange-httpd_terms.c
+++ b/src/exchange/taler-exchange-httpd_terms.c
@@ -171,6 +171,7 @@ TEH_handler_terms (struct TEH_RequestHandler *rh,
MHD_HEADER_KIND,
MHD_HTTP_HEADER_IF_NONE_MATCH);
if ( (NULL != etag) &&
+ (NULL != terms_etag) &&
(0 == strcasecmp (etag,
terms_etag)) )
{
@@ -205,7 +206,7 @@ TEH_handler_terms (struct TEH_RequestHandler *rh,
mime = "text/html";
/* Find best match: must match mime type (if possible), and if
mime type matches, ideally also language */
- for (unsigned int i = 0; NULL != terms[i].terms; i++)
+ for (unsigned int i = 0; i < terms_len; i++)
{
struct Terms *p = &terms[i];
@@ -332,9 +333,10 @@ load_terms (const char *path,
lang);
return;
}
- if (0 != strncmp (terms_etag,
- name,
- ext - name - 1))
+ if ( (NULL == terms_etag) ||
+ (0 != strncmp (terms_etag,
+ name,
+ ext - name - 1)) )
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Filename `%s' does not match Etag `%s' in directory `%s/%s'. Ignoring it.\n",