proc_misc.c comments

From: tom st denis
Date: Wed Jun 23 2004 - 08:37:44 EST


I was toying around with the idea of making /proc/meminfo use KiB as
the unit instead of KB [just something to waste 10 mins] when I noticed
that you guys have prototypes like

static int meminfo_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)


Then do things like

len = sprintf(page,

Wouldn't it be safer to pass the size of "page" into the function and
use snprintf to prevent any possible buffer overflows?

Sure right now it's not a problem but it would make the code easier to
review, say when someone wants to add a /proc/thingymagingy later on in
the future.

I'm still a kernel newbie so I'll defer the coding work to other people
;-) Just thought I would point that out.

Tom




__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
-
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/