netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] null pointer exception
@ 2015-11-28  1:55 Linmujia
  2015-11-28 12:20 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Linmujia @ 2015-11-28  1:55 UTC (permalink / raw)
  To: pablo@netfilter.org; +Cc: netfilter-devel@vger.kernel.org

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(-)

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);
 	}
-- 
2.5.1.windows.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nft] null pointer exception
  2015-11-28  1:55 [PATCH nft] null pointer exception Linmujia
@ 2015-11-28 12:20 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2015-11-28 12:20 UTC (permalink / raw)
  To: Linmujia; +Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-28 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-28  1:55 [PATCH nft] null pointer exception Linmujia
2015-11-28 12:20 ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).