public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 6/6] s390: qeth network driver.
Date: Tue, 30 Nov 2004 12:48:03 -0500	[thread overview]
Message-ID: <41ACB253.9090202@pobox.com> (raw)
In-Reply-To: <20041130151013.GG4758@mschwid3.boeblingen.de.ibm.com>

Martin Schwidefsky wrote:
> @@ -1308,6 +1326,15 @@
>  			continue;
>  		if (ipaddr->type != QETH_IP_TYPE_RXIP)
>  			continue;
> +		/* String must not be longer than PAGE_SIZE. So we check for
> +		 * length >= 3900 here. Then we can savely display the next
> +		 * IPv6 address and our info message below */
> +		if (i >= 3900) {
> +			i += sprintf(buf + i,
> +				     "... Too many entries to be displayed. "
> +				     "Skipping remaining entries.\n");
> +			break;
> +		}


ACK, although I dislike the open-coding of the magic number 3900.

3900 strikes me as an engineer's guess, not a rigorous limit on strings, 
thus inviting the possibility of a buffer overflow years later.

	Jeff



  reply	other threads:[~2004-11-30 17:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-30 15:10 [patch 6/6] s390: qeth network driver Martin Schwidefsky
2004-11-30 17:48 ` Jeff Garzik [this message]
2004-11-30 17:50   ` Alan Cox
2004-11-30 18:15     ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41ACB253.9090202@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox