netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 'nother pull request
@ 2009-02-12  6:19 Jan Engelhardt
  2009-02-12  6:19 ` [PATCH 1/3] libxtables: use const for vars holding literals Jan Engelhardt
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jan Engelhardt @ 2009-02-12  6:19 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber


And pull again (wasnot sure if you had seen the patches already),
to receive some bugfixes I cooked in response
to ljlane's request to peek at Debian bugs.

Jan Engelhardt (3):
      libxtables: use const for vars holding literals
      libxt_string: fix undefined behavior/incorrect patlen calculation
      libxtables: flush before fork

 extensions/libxt_string.c |    4 +++-
 include/xtables.h.in      |    3 +--
 xtables.c                 |    6 ++++++
 3 files changed, 10 insertions(+), 3 deletions(-)

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

* [PATCH 1/3] libxtables: use const for vars holding literals
  2009-02-12  6:19 'nother pull request Jan Engelhardt
@ 2009-02-12  6:19 ` Jan Engelhardt
  2009-02-12  6:19 ` [PATCH 2/3] libxt_string: fix undefined behavior/incorrect patlen calculation Jan Engelhardt
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2009-02-12  6:19 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 include/xtables.h.in |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/xtables.h.in b/include/xtables.h.in
index 6712aac..ae1594a 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h.in
@@ -186,8 +186,7 @@ enum xtables_exittype {
 struct xtables_globals
 {
 	unsigned int option_offset;
-	char *program_version;
-	char *program_name;
+	const char *program_name, *program_version;
 	struct option *opts;
 	void (*exit_err)(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
 };
-- 
1.6.1.2


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

* [PATCH 2/3] libxt_string: fix undefined behavior/incorrect patlen calculation
  2009-02-12  6:19 'nother pull request Jan Engelhardt
  2009-02-12  6:19 ` [PATCH 1/3] libxtables: use const for vars holding literals Jan Engelhardt
@ 2009-02-12  6:19 ` Jan Engelhardt
  2009-02-12  6:19 ` [PATCH 3/3] libxtables: flush before fork Jan Engelhardt
  2009-02-12  6:21 ` 'nother pull request Patrick McHardy
  3 siblings, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2009-02-12  6:19 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber

strlen ran over the end of the string. Use strnlen to bound it.

Reference: http://bugs.debian.org/513516
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 extensions/libxt_string.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/extensions/libxt_string.c b/extensions/libxt_string.c
index 6bd27c0..aa52fa8 100644
--- a/extensions/libxt_string.c
+++ b/extensions/libxt_string.c
@@ -20,6 +20,7 @@
  *             updated to work with slightly modified
  *             ipt_string_info.
  */
+#define _GNU_SOURCE 1
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
@@ -207,7 +208,8 @@ string_parse(int c, char **argv, int invert, unsigned int *flags,
 			else
 				stringinfo->u.v1.flags |= XT_STRING_FLAG_INVERT;
 		}
-		stringinfo->patlen=strlen((char *)&stringinfo->pattern);
+		stringinfo->patlen = strnlen((char *)&stringinfo->pattern,
+			sizeof(stringinfo->patlen));
 		*flags |= STRING;
 		break;
 
-- 
1.6.1.2


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

* [PATCH 3/3] libxtables: flush before fork
  2009-02-12  6:19 'nother pull request Jan Engelhardt
  2009-02-12  6:19 ` [PATCH 1/3] libxtables: use const for vars holding literals Jan Engelhardt
  2009-02-12  6:19 ` [PATCH 2/3] libxt_string: fix undefined behavior/incorrect patlen calculation Jan Engelhardt
@ 2009-02-12  6:19 ` Jan Engelhardt
  2009-02-12  6:21 ` 'nother pull request Patrick McHardy
  3 siblings, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2009-02-12  6:19 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber

Reference: http://bugs.debian.org/514869
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 xtables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xtables.c b/xtables.c
index 02bfc17..d85e639 100644
--- a/xtables.c
+++ b/xtables.c
@@ -272,6 +272,12 @@ int xtables_insmod(const char *modname, const char *modprobe, bool quiet)
 		modprobe = buf;
 	}
 
+	/*
+	 * Need to flush the buffer, or the child may output it again
+	 * when switching the program thru execv.
+	 */
+	fflush(stdout);
+
 	switch (fork()) {
 	case 0:
 		argv[0] = (char *)modprobe;
-- 
1.6.1.2


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

* Re: 'nother pull request
  2009-02-12  6:19 'nother pull request Jan Engelhardt
                   ` (2 preceding siblings ...)
  2009-02-12  6:19 ` [PATCH 3/3] libxtables: flush before fork Jan Engelhardt
@ 2009-02-12  6:21 ` Patrick McHardy
  3 siblings, 0 replies; 5+ messages in thread
From: Patrick McHardy @ 2009-02-12  6:21 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: netfilter-devel

Jan Engelhardt wrote:
> And pull again (wasnot sure if you had seen the patches already),
> to receive some bugfixes I cooked in response
> to ljlane's request to peek at Debian bugs.
> 
> Jan Engelhardt (3):
>       libxtables: use const for vars holding literals
>       libxt_string: fix undefined behavior/incorrect patlen calculation
>       libxtables: flush before fork
> 
>  extensions/libxt_string.c |    4 +++-
>  include/xtables.h.in      |    3 +--
>  xtables.c                 |    6 ++++++
>  3 files changed, 10 insertions(+), 3 deletions(-)

Also pulled and pushed out, thanks.

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

end of thread, other threads:[~2009-02-12  6:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-12  6:19 'nother pull request Jan Engelhardt
2009-02-12  6:19 ` [PATCH 1/3] libxtables: use const for vars holding literals Jan Engelhardt
2009-02-12  6:19 ` [PATCH 2/3] libxt_string: fix undefined behavior/incorrect patlen calculation Jan Engelhardt
2009-02-12  6:19 ` [PATCH 3/3] libxtables: flush before fork Jan Engelhardt
2009-02-12  6:21 ` 'nother pull request 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).