All of lore.kernel.org
 help / color / mirror / Atom feed
* [nft PATCH] erec: Sanitize erec location indesc
@ 2021-01-26 17:55 Phil Sutter
  2021-02-03  0:38 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 10+ messages in thread
From: Phil Sutter @ 2021-01-26 17:55 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

erec_print() unconditionally dereferences erec->locations->indesc, so
make sure it is valid when either creating an erec or adding a location.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/erec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/erec.c b/src/erec.c
index c550a596b38c8..5c3351a512464 100644
--- a/src/erec.c
+++ b/src/erec.c
@@ -38,7 +38,8 @@ void erec_add_location(struct error_record *erec, const struct location *loc)
 {
 	assert(erec->num_locations < EREC_LOCATIONS_MAX);
 	erec->locations[erec->num_locations] = *loc;
-	erec->locations[erec->num_locations].indesc = loc->indesc;
+	erec->locations[erec->num_locations].indesc = loc->indesc ?
+						    : &internal_indesc;
 	erec->num_locations++;
 }
 
-- 
2.28.0


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

end of thread, other threads:[~2021-02-09 16:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 17:55 [nft PATCH] erec: Sanitize erec location indesc Phil Sutter
2021-02-03  0:38 ` Pablo Neira Ayuso
2021-02-03 10:45   ` Phil Sutter
2021-02-09 13:15     ` Pablo Neira Ayuso
2021-02-09 13:22       ` Pablo Neira Ayuso
2021-02-09 14:11       ` Phil Sutter
2021-02-09 15:50         ` Pablo Neira Ayuso
2021-02-09 15:53           ` Pablo Neira Ayuso
2021-02-09 15:54             ` Pablo Neira Ayuso
2021-02-09 16:01               ` Phil Sutter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.