diff options
author | Phil Sutter <phil@nwl.cc> | 2016-08-30 19:39:49 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-09-05 18:37:16 +0200 |
commit | 7a5b4c505e4d460239ac8a36b4fbccf222cd6134 (patch) | |
tree | 00ba9ca65f77fee22092807f20f8095ddf621e1f /src/statement.c | |
parent | d815b8d2bf18bc589f10c3fb4524a2b93fe91b93 (diff) |
evaluate: Fix datalen checks in expr_evaluate_string()
I have been told that the flex scanner won't return empty strings, so
strlen(data) should always be greater 0. To avoid a hard to debug issue
though, add an assert() to make sure this is always the case before
risking an unsigned variable underrun.
A real issue though is the check for 'datalen - 1 >= 0', which will
never fail due to datalen being unsigned. Fix this by incrementing both
sides by one, hence checking 'datalen >= 1'.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/statement.c')
0 files changed, 0 insertions, 0 deletions