[PATCH nft] null pointer exception

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux