lkml.org 
[lkml]   [2004]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 6/6] s390: qeth network driver.
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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.044 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site