aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-04-04 19:19:26 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-04-04 19:19:26 +0200
commit4c9557ef24f267ad0912f1bff6b0fdcb52c74e68 (patch)
tree339fcec4f5244553b740add467333a9300d023b7 /openbsc/include
parent13673749ffdd8947af5ff69e477f9144e8afc57f (diff)
nat: Bail out if the regexp fails to compile and avoid a crash
If the regexp fails to compile the internal dfa is NULL and a regexec will crash nicely. Fail and free the string if the regexp fails to compile.
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/bsc_nat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index af753cc40..d6f61a6f4 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -332,7 +332,7 @@ int bsc_write_msg(struct write_queue *queue, struct msgb *msg);
int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg);
/* IMSI allow/deny handling */
-void bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv);
+int bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv) __attribute__ ((warn_unused_result));
struct bsc_nat_acc_lst *bsc_nat_acc_lst_find(struct bsc_nat *nat, const char *name);
struct bsc_nat_acc_lst *bsc_nat_acc_lst_get(struct bsc_nat *nat, const char *name);
void bsc_nat_acc_lst_delete(struct bsc_nat_acc_lst *lst);