Re: [patch 6/6] s390: qeth network driver.

From: Jeff Garzik
Date: Tue Nov 30 2004 - 12:49:25 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/