Debian Bug report logs -
#264672
mtr-tiny: Updated patch submission
Reported by: Josh Martin <jmartin@columbiaservices.net>
Date: Mon, 9 Aug 2004 21:33:04 UTC
Severity: normal
Tags: patch
Found in version 0.58-1
Fixed in versions mtr/0.63-1, 0.59-1
Done: Ryan Niebur <ryanryan52@gmail.com>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Robert Woodcock <rcw@debian.org>:
Bug#264672; Package mtr-tiny.
(full text, mbox, link).
Acknowledgement sent to Josh Martin <jmartin@columbiaservices.net>:
New Bug report received and forwarded. Copy sent to Robert Woodcock <rcw@debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Subject: mtr-tiny: Updated patch submission
Followup-For: Bug #264055
Package: mtr-tiny
Version: 0.58-1
Tags: patch
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.7
Locale: LANG=C, LC_CTYPE=C
Versions of packages mtr-tiny depends on:
ii libc6 2.3.2.ds1-15 GNU C Library: Shared libraries
an
ii libncurses5 5.4-4 Shared libraries for terminal
hand
-- no debconf information
I have attached an updated patch that also patches the command line
version of this problem.
[mtr-patch.diff (text/x-diff, attachment)]
Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#264672; Package mtr-tiny.
(full text, mbox, link).
Acknowledgement sent to Robert Woodcock <rcw@debian.org>:
Extra info received and forwarded to list.
(full text, mbox, link).
Message #10 received at 264672@bugs.debian.org (full text, mbox, reply):
Forwarding, since Josh didn't send this to the bug or to Rogier...
----- Forwarded message from Josh Martin <jmartin@columbiaservices.net> -----
From: Josh Martin <jmartin@columbiaservices.net>
Subject: Fwd: Re: mtr-tiny patch submission (disgregard earlier)
Date: Mon, 9 Aug 2004 17:02:26 -0700
To: rcw@debian.org
Attached is revision 3 of my patchwork. I hope you enjoy it.
On Monday 09 August 2004 14:41, you wrote:
> On Mon, Aug 09, 2004 at 12:05:32PM -0700, Josh Martin wrote:
> > Please disregard my patch from this morning. I seem to have been half
> > asleep.
> >
> > I have included a complete *working* patch. this also patches the
> > command line option, ( mtr --curses -o F ) as well as the manual
> > entering of the order bug. This patch patches the folowing files:
> >
> > mtr-curses.h define available options
> > mtr.c clean the -o commandline arg
> > curses.c clean the manual entry for the order
> >
> > There is what looks like an overflow when entering the manual order, I
> > was hesitant to add another integer to test the total number of
> > characters at this time. If these patches are usable, I will continue to
> > add another to remove this annoying display. As far as the seg faults,
> > this should clear them all up :)
>
> while ( (c=getch ()) != '\n' && i<MAXFLD ) {
> attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
> - if( (c>= 'A' && c<= 'Z') || c==' ') {
> - buf[i++] = c; /* only accept [ A-Z], can be extend to [a-z0-9] */
> + if(strchr (OPTIONS,c)) {
> + buf[i++] = c; /* Only permit values in OPTIONS be entered */
> }
>
> Would it be an idea to do something like:
>
> while ( (c=getch ()) != '\n' && i<MAXFLD ) {
> if(strchr (OPTIONS,c)) {
> attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
> buf[i++] = c; /* Only permit values in OPTIONS be entered */
> } else {
> printw ("%c", '\b'); /* Illegal character. Beep, ring the bell. */
> }
>
> where you figure out the right way to generate a BEEP instead of
> just printing the (silently refused) character on the screen.
>
> Oh, And I like spaces around
> while ( (c=getch ()) != '\n' && i<MAXFLD ) {
> as in:
> while ( (c = getch ()) != '\n' && i < MAXFLD ) {
>
> and in:
>
> - if( (c>= 'A' && c<= 'Z') || c==' ') {
> -> if( (c >= 'A' && c <= 'Z') || c == ' ') {
>
> but I see you REMOVED that line, so apparently it already WAS bad...
>
> Roger.
--
Josh Martin
jmartin@prescientsoftware.com
-------------------------------------------------------
--
Josh Martin
jmartin@prescientsoftware.com
--- mtr-0.58.orig/curses.c 2004-08-09 15:20:24.000000000 -0700
+++ mtr-0.58/curses.c 2004-08-09 16:16:21.000000000 -0700
@@ -254,10 +254,12 @@
refresh();
i = 0;
- while ( (c=getch ()) != '\n' && i<MAXFLD ) {
- attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
- if( (c>= 'A' && c<= 'Z') || c==' ') {
- buf[i++] = c; /* only accept [ A-Z], can be extend to [a-z0-9] */
+ while ( (c=getch ()) != '\n' && i < MAXFLD ) {
+ if( strchr(OPTIONS, c) ) {
+ attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
+ buf[i++] = c; /* Only permit values in OPTIONS be entered */
+ } else {
+ printf("\a"); /* Illegal character. Beep, ring the bell. */
}
}
buf[i] = '\0';
--- mtr-0.58.orig/mtr-curses.h 2004-08-09 15:20:24.000000000 -0700
+++ mtr-0.58/mtr-curses.h 2004-08-09 15:31:19.000000000 -0700
@@ -17,6 +17,9 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/* Define available order options */
+#define OPTIONS "LDRSNBAWVGJMXI "
+
/* Prototypes for curses.c */
void mtr_curses_open();
void mtr_curses_close();--- mtr-0.58.orig/mtr.c 2004-08-09 15:20:24.000000000 -0700
+++ mtr-0.58/mtr.c 2004-08-09 15:35:56.000000000 -0700
@@ -40,6 +40,8 @@
#define seteuid setuid
#endif
+int i;
+int j;
int DisplayMode;
int display_mode;
int Interactive = 1;
@@ -192,8 +194,14 @@
}
break;
case 'o':
- /* XXX no error checking on the input string, lazy */
- strncpy (fld_active, optarg, MAXFLD-1 );
+ /* clean optarg before placing in fld_active */
+ j=0;
+ for( i=0; i<strlen(optarg); i++ ) {
+ if( strchr(OPTIONS, optarg[i]) && i < MAXFLD ) {
+ fld_active[j++] = optarg[i];
+ }
+ }
+ fld_active[j++] = '\0';
break;
case 'b':
bitpattern = atoi (optarg);
----- End forwarded message -----
--
Robert Woodcock - rcw@debian.org
"I can't quite find a good answer to why I want to write open source
software; it's like asking why I want to spend time breathing."
-- Keith Packard
Information forwarded to debian-bugs-dist@lists.debian.org, Robert Woodcock <rcw@debian.org>:
Bug#264672; Package mtr-tiny.
(full text, mbox, link).
Acknowledgement sent to Rogier Wolff <R.E.Wolff@BitWizard.nl>:
Extra info received and forwarded to list. Copy sent to Robert Woodcock <rcw@debian.org>.
(full text, mbox, link).
Message #15 received at 264672@bugs.debian.org (full text, mbox, reply):
On Mon, Aug 09, 2004 at 05:32:28PM -0700, Robert Woodcock wrote:
> Forwarding, since Josh didn't send this to the bug or to Rogier...
Oh well, I did get it. (eventually?)
Roger.
>
> ----- Forwarded message from Josh Martin <jmartin@columbiaservices.net> -----
>
> From: Josh Martin <jmartin@columbiaservices.net>
> Subject: Fwd: Re: mtr-tiny patch submission (disgregard earlier)
> Date: Mon, 9 Aug 2004 17:02:26 -0700
> To: rcw@debian.org
>
> Attached is revision 3 of my patchwork. I hope you enjoy it.
>
> On Monday 09 August 2004 14:41, you wrote:
> > On Mon, Aug 09, 2004 at 12:05:32PM -0700, Josh Martin wrote:
> > > Please disregard my patch from this morning. I seem to have been half
> > > asleep.
> > >
> > > I have included a complete *working* patch. this also patches the
> > > command line option, ( mtr --curses -o F ) as well as the manual
> > > entering of the order bug. This patch patches the folowing files:
> > >
> > > mtr-curses.h define available options
> > > mtr.c clean the -o commandline arg
> > > curses.c clean the manual entry for the order
> > >
> > > There is what looks like an overflow when entering the manual order, I
> > > was hesitant to add another integer to test the total number of
> > > characters at this time. If these patches are usable, I will continue to
> > > add another to remove this annoying display. As far as the seg faults,
> > > this should clear them all up :)
> >
> > while ( (c=getch ()) != '\n' && i<MAXFLD ) {
> > attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
> > - if( (c>= 'A' && c<= 'Z') || c==' ') {
> > - buf[i++] = c; /* only accept [ A-Z], can be extend to [a-z0-9] */
> > + if(strchr (OPTIONS,c)) {
> > + buf[i++] = c; /* Only permit values in OPTIONS be entered */
> > }
> >
> > Would it be an idea to do something like:
> >
> > while ( (c=getch ()) != '\n' && i<MAXFLD ) {
> > if(strchr (OPTIONS,c)) {
> > attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
> > buf[i++] = c; /* Only permit values in OPTIONS be entered */
> > } else {
> > printw ("%c", '\b'); /* Illegal character. Beep, ring the bell. */
> > }
> >
> > where you figure out the right way to generate a BEEP instead of
> > just printing the (silently refused) character on the screen.
> >
> > Oh, And I like spaces around
> > while ( (c=getch ()) != '\n' && i<MAXFLD ) {
> > as in:
> > while ( (c = getch ()) != '\n' && i < MAXFLD ) {
> >
> > and in:
> >
> > - if( (c>= 'A' && c<= 'Z') || c==' ') {
> > -> if( (c >= 'A' && c <= 'Z') || c == ' ') {
> >
> > but I see you REMOVED that line, so apparently it already WAS bad...
> >
> > Roger.
>
> --
> Josh Martin
> jmartin@prescientsoftware.com
>
> -------------------------------------------------------
>
>
>
> --
> Josh Martin
> jmartin@prescientsoftware.com
>
> --- mtr-0.58.orig/curses.c 2004-08-09 15:20:24.000000000 -0700
> +++ mtr-0.58/curses.c 2004-08-09 16:16:21.000000000 -0700
> @@ -254,10 +254,12 @@
> refresh();
>
> i = 0;
> - while ( (c=getch ()) != '\n' && i<MAXFLD ) {
> - attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
> - if( (c>= 'A' && c<= 'Z') || c==' ') {
> - buf[i++] = c; /* only accept [ A-Z], can be extend to [a-z0-9] */
> + while ( (c=getch ()) != '\n' && i < MAXFLD ) {
> + if( strchr(OPTIONS, c) ) {
> + attron(A_BOLD); printw("%c", c); attroff(A_BOLD); refresh();
> + buf[i++] = c; /* Only permit values in OPTIONS be entered */
> + } else {
> + printf("\a"); /* Illegal character. Beep, ring the bell. */
> }
> }
> buf[i] = '\0';
> --- mtr-0.58.orig/mtr-curses.h 2004-08-09 15:20:24.000000000 -0700
> +++ mtr-0.58/mtr-curses.h 2004-08-09 15:31:19.000000000 -0700
> @@ -17,6 +17,9 @@
> Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> */
>
> +/* Define available order options */
> +#define OPTIONS "LDRSNBAWVGJMXI "
> +
> /* Prototypes for curses.c */
> void mtr_curses_open();
> void mtr_curses_close();--- mtr-0.58.orig/mtr.c 2004-08-09 15:20:24.000000000 -0700
> +++ mtr-0.58/mtr.c 2004-08-09 15:35:56.000000000 -0700
> @@ -40,6 +40,8 @@
> #define seteuid setuid
> #endif
>
> +int i;
> +int j;
> int DisplayMode;
> int display_mode;
> int Interactive = 1;
> @@ -192,8 +194,14 @@
> }
> break;
> case 'o':
> - /* XXX no error checking on the input string, lazy */
> - strncpy (fld_active, optarg, MAXFLD-1 );
> + /* clean optarg before placing in fld_active */
> + j=0;
> + for( i=0; i<strlen(optarg); i++ ) {
> + if( strchr(OPTIONS, optarg[i]) && i < MAXFLD ) {
> + fld_active[j++] = optarg[i];
> + }
> + }
> + fld_active[j++] = '\0';
> break;
> case 'b':
> bitpattern = atoi (optarg);
>
>
> ----- End forwarded message -----
>
> --
> Robert Woodcock - rcw@debian.org
> "I can't quite find a good answer to why I want to write open source
> software; it's like asking why I want to spend time breathing."
> -- Keith Packard
>
>
--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
**** "Linux is like a wigwam - no windows, no gates, apache inside!" ****
Information forwarded to debian-bugs-dist@lists.debian.org, Robert Woodcock <rcw@debian.org>:
Bug#264672; Package mtr-tiny.
(full text, mbox, link).
Acknowledgement sent to Florian Ernst <florian@uni-hd.de>:
Extra info received and forwarded to list. Copy sent to Robert Woodcock <rcw@debian.org>.
(full text, mbox, link).
Message #20 received at 264672@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Browsing through the code of 0.67-1 and 0.69-2 I see upstream
basically covers this issue via a different implementation of sanity
checks, so I guess this bug can be closed.
Using the version tracking feature of the BTS a mail to
<264672-done@bugs.debian.org> with the body starting with
| Package: mtr
| Version: 0.67-1
|
and adding an explanation will probably suffice.
HTH,
Flo
[signature.asc (application/pgp-signature, inline)]
Reply sent
to Ryan Niebur <ryanryan52@gmail.com>:
You have taken responsibility.
(Tue, 12 May 2009 07:57:04 GMT) (full text, mbox, link).
Notification sent
to Josh Martin <jmartin@columbiaservices.net>:
Bug acknowledged by developer.
(Tue, 12 May 2009 07:57:05 GMT) (full text, mbox, link).
Message #25 received at 264672-done@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Version: 0.59-1
The bug that this patch is for, #264055, has already been marked fixed
in version 0.59-1. therefor I close this bug with that version as
well.
--
_________________________
Ryan Niebur
ryanryan52@gmail.com
[signature.asc (application/pgp-signature, inline)]
Marked as fixed in versions mtr/0.63-1.
Request was from Andreas Beckmann <anbe@debian.org>
to control@bugs.debian.org.
(Fri, 01 Nov 2013 01:21:18 GMT) (full text, mbox, link).
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Fri, 29 Nov 2013 07:43:26 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Wed Oct 11 00:26:58 2017;
Machine Name:
beach
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.