diff mbox

[nft] null pointer exception

Message ID 0A900C78B9F2324AB7F4F7A51D1A2F857797855C@szxema505-mbs.china.huawei.com
State Not Applicable
Delegated to: Pablo Neira
Headers show

Commit Message

lin mujia Nov. 28, 2015, 1:55 a.m. UTC
Hi,I think I find out why my last patch stoped the execution of the tool,
If "stmt_reject_gen_dependency" do not get any payload (payload=null) , it can not call "payload_gen_dependency ",it will cause null pointer exception.

Thanks.



Signed-off-by: linmujia <linmujia@huawei.com>
---
 src/evaluate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Patrick McHardy Nov. 28, 2015, 12:20 p.m. UTC | #1
On 28.11, Linmujia wrote:
> Hi,I think I find out why my last patch stoped the execution of the tool,
> If "stmt_reject_gen_dependency" do not get any payload (payload=null) , it can not call "payload_gen_dependency ",it will cause null pointer exception.
> 

It is really unclear what you're trying to do. You've sent multiple patches
of which every single one was competely wrong and randomly changing return
values.

How about you start by explaining what you're trying to do?
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/evaluate.c b/src/evaluate.c
index 7aab6aa..bcc2670 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1428,7 +1428,7 @@  static int reject_payload_gen_dependency_family(struct eval_ctx *ctx,
 	default:
 		BUG("unknown reject family");
 	}
-	return 1;
+	return -1;
 }
 
 static int stmt_reject_gen_dependency(struct eval_ctx *ctx, struct stmt *stmt,
@@ -1446,6 +1446,7 @@  static int stmt_reject_gen_dependency(struct eval_ctx *ctx, struct stmt *stmt,
 		ret = reject_payload_gen_dependency_family(ctx, stmt, &payload);
 		break;
 	default:
+		ret = -1;
 		BUG("cannot generate reject dependency for type %d",
 		    stmt->reject.type);
 	}