gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: check regex syntax at least


From: gnunet
Subject: [taler-exchange] branch master updated: check regex syntax at least
Date: Tue, 02 May 2023 21:48:26 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 8e0f9b40 check regex syntax at least
8e0f9b40 is described below

commit 8e0f9b40c0ffcf3367b9a0cf2e1f0bebda34e0cb
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue May 2 21:48:23 2023 +0200

    check regex syntax at least
---
 src/exchange-tools/taler-exchange-offline.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/exchange-tools/taler-exchange-offline.c 
b/src/exchange-tools/taler-exchange-offline.c
index fbf8a6ac..80765dd9 100644
--- a/src/exchange-tools/taler-exchange-offline.c
+++ b/src/exchange-tools/taler-exchange-offline.c
@@ -24,6 +24,8 @@
 #include "taler_json_lib.h"
 #include "taler_exchange_service.h"
 #include "taler_extensions.h"
+#include <regex.h>
+
 
 /**
  * Name of the input for the 'sign' and 'show' operation.
@@ -3017,6 +3019,21 @@ parse_restriction (char *const *args,
                   "Mandatory arguments for restriction of type `regex' missing 
(REGEX, HINT, HINT-I18 required)\n");
       return -1;
     }
+    {
+      regex_t ex;
+
+      if (0 != regcomp (&ex,
+                        args[1],
+                        REG_NOSUB | REG_EXTENDED))
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Invalid regular expression `%s'\n",
+                    args[1]);
+        return -1;
+      }
+      regfree (&ex);
+    }
+
     i18n = json_loads (args[3],
                        JSON_REJECT_DUPLICATES,
                        &err);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]