aboutsummaryrefslogtreecommitdiff
path: root/src/regex
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/gnunet-service-regex.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/regex/gnunet-service-regex.c b/src/regex/gnunet-service-regex.c
index eb10e7c07..9b9cad231 100644
--- a/src/regex/gnunet-service-regex.c
+++ b/src/regex/gnunet-service-regex.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -131,16 +131,8 @@ check_announce (void *cls,
131 const struct AnnounceMessage *am) 131 const struct AnnounceMessage *am)
132{ 132{
133 struct ClientEntry *ce = cls; 133 struct ClientEntry *ce = cls;
134 const char *regex;
135 uint16_t size;
136 134
137 size = ntohs (am->header.size) - sizeof (*am); 135 GNUNET_MQ_check_zero_termination (am);
138 regex = (const char *) &am[1];
139 if ('\0' != regex[size - 1])
140 {
141 GNUNET_break (0);
142 return GNUNET_SYSERR;
143 }
144 if (NULL != ce->ah) 136 if (NULL != ce->ah)
145 { 137 {
146 /* only one announcement per client allowed */ 138 /* only one announcement per client allowed */