From 2b8e0cf85ec73ffe44e2639357808eac14e16cff Mon Sep 17 00:00:00 2001 From: Andreas Klemm Date: Wed, 27 Dec 2000 14:19:33 +0000 Subject: [PATCH] Fix vty memory leak Patch in PR contains typo, got clean patch from zebra anon cvs server Wrote e-mail to security officer and freebsd-audit to ask for a) review b) what to do next (FreeBSD Ports Security Advisory?...) concerning a) the author of zebra already ok'd the patch. converning b) waiting for SO or fbsd-auditers to respond PR: 23856 Submitted by: Vincent Poy Reviewed by: Kunihiro Ishiguro Approved by: Kunihiro Ishiguro Obtained from: PR (partly) + zebra anon cvs server --- net/zebra-devel/Makefile | 1 + .../files/patch-001_vty_memory_leak | 18 ++++++++++++++++++ net/zebra-pj/Makefile | 1 + net/zebra-pj/files/patch-001_vty_memory_leak | 18 ++++++++++++++++++ net/zebra/Makefile | 1 + net/zebra/files/patch-001_vty_memory_leak | 18 ++++++++++++++++++ 6 files changed, 57 insertions(+) create mode 100644 net/zebra-devel/files/patch-001_vty_memory_leak create mode 100644 net/zebra-pj/files/patch-001_vty_memory_leak create mode 100644 net/zebra/files/patch-001_vty_memory_leak diff --git a/net/zebra-devel/Makefile b/net/zebra-devel/Makefile index c3aaa4063ddd..b05feb461b64 100644 --- a/net/zebra-devel/Makefile +++ b/net/zebra-devel/Makefile @@ -7,6 +7,7 @@ PORTNAME= zebra PORTVERSION= 0.89a +PORTREVISION= 1 CATEGORIES= net ipv6 MASTER_SITES= ftp://ftp.zebra.org/pub/zebra/ # you might need debugging, it's a developer release ! diff --git a/net/zebra-devel/files/patch-001_vty_memory_leak b/net/zebra-devel/files/patch-001_vty_memory_leak new file mode 100644 index 000000000000..1800c6f3cad0 --- /dev/null +++ b/net/zebra-devel/files/patch-001_vty_memory_leak @@ -0,0 +1,18 @@ +--- vty.c.orig Tue Sep 26 23:03:12 2000 ++++ vty.c Tue Dec 26 23:18:00 2000 +@@ -1850,10 +1849,13 @@ + printf ("line: %s\n", buf); + #endif /* VTYSH_DEBUG */ + ++ vty_ensure (vty, nbytes); ++ memcpy (vty->buf, buf, nbytes); ++ + /* Pass this line to parser. */ +- vty->buf = buf; + ret = vty_execute (vty); +- vty->buf = NULL; ++ ++ vty_clear_buf (vty); + + /* Return result. */ + #ifdef VTYSH_DEBUG diff --git a/net/zebra-pj/Makefile b/net/zebra-pj/Makefile index c3aaa4063ddd..b05feb461b64 100644 --- a/net/zebra-pj/Makefile +++ b/net/zebra-pj/Makefile @@ -7,6 +7,7 @@ PORTNAME= zebra PORTVERSION= 0.89a +PORTREVISION= 1 CATEGORIES= net ipv6 MASTER_SITES= ftp://ftp.zebra.org/pub/zebra/ # you might need debugging, it's a developer release ! diff --git a/net/zebra-pj/files/patch-001_vty_memory_leak b/net/zebra-pj/files/patch-001_vty_memory_leak new file mode 100644 index 000000000000..1800c6f3cad0 --- /dev/null +++ b/net/zebra-pj/files/patch-001_vty_memory_leak @@ -0,0 +1,18 @@ +--- vty.c.orig Tue Sep 26 23:03:12 2000 ++++ vty.c Tue Dec 26 23:18:00 2000 +@@ -1850,10 +1849,13 @@ + printf ("line: %s\n", buf); + #endif /* VTYSH_DEBUG */ + ++ vty_ensure (vty, nbytes); ++ memcpy (vty->buf, buf, nbytes); ++ + /* Pass this line to parser. */ +- vty->buf = buf; + ret = vty_execute (vty); +- vty->buf = NULL; ++ ++ vty_clear_buf (vty); + + /* Return result. */ + #ifdef VTYSH_DEBUG diff --git a/net/zebra/Makefile b/net/zebra/Makefile index c3aaa4063ddd..b05feb461b64 100644 --- a/net/zebra/Makefile +++ b/net/zebra/Makefile @@ -7,6 +7,7 @@ PORTNAME= zebra PORTVERSION= 0.89a +PORTREVISION= 1 CATEGORIES= net ipv6 MASTER_SITES= ftp://ftp.zebra.org/pub/zebra/ # you might need debugging, it's a developer release ! diff --git a/net/zebra/files/patch-001_vty_memory_leak b/net/zebra/files/patch-001_vty_memory_leak new file mode 100644 index 000000000000..1800c6f3cad0 --- /dev/null +++ b/net/zebra/files/patch-001_vty_memory_leak @@ -0,0 +1,18 @@ +--- vty.c.orig Tue Sep 26 23:03:12 2000 ++++ vty.c Tue Dec 26 23:18:00 2000 +@@ -1850,10 +1849,13 @@ + printf ("line: %s\n", buf); + #endif /* VTYSH_DEBUG */ + ++ vty_ensure (vty, nbytes); ++ memcpy (vty->buf, buf, nbytes); ++ + /* Pass this line to parser. */ +- vty->buf = buf; + ret = vty_execute (vty); +- vty->buf = NULL; ++ ++ vty_clear_buf (vty); + + /* Return result. */ + #ifdef VTYSH_DEBUG