diff options
author | Carlos Falgueras García <carlosfg@riseup.net> | 2016-06-20 12:29:19 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-06-22 19:25:14 +0200 |
commit | 59cb13bb62b36efa25b29fe280ada7b1f0984325 (patch) | |
tree | 39c6b27df766b774e651a8973868d57d51f9e2d0 /src/expr | |
parent | 2fee091b0dd1741a8a87cafceaa0091adadd2b46 (diff) |
src: fix missing error checking in parser functions
Bail out on errors in several nftnl_*_nlmsg_parse() functions. We can
overwrite the previous error value, and may execute code which should
not.
Bad way:
int f() {
int ret;
ret = g();
ret = h();
return ret;
}
Good way:
int f() {
int ret;
ret = g();
if (ret < 0)
return ret;
ret = h();
if (ret < 0)
return ret;
return 0;
}
Signed-off-by: Carlos Falgueras García <carlosfg@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr')
0 files changed, 0 insertions, 0 deletions