From: Andreas Schwab <schwab@suse.de>
To: Andreas Gruenbacher <agruen@suse.de>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: NULL terminate over-long /proc/kallsyms symbols
Date: Wed, 05 Jul 2006 19:13:00 +0200 [thread overview]
Message-ID: <jewtasm0v7.fsf@sykes.suse.de> (raw)
In-Reply-To: <200607051859.41638.agruen@suse.de> (Andreas Gruenbacher's message of "Wed, 5 Jul 2006 18:59:41 +0200")
Andreas Gruenbacher <agruen@suse.de> writes:
> Index: linux-2.6.17/kernel/module.c
> ===================================================================
> --- linux-2.6.17.orig/kernel/module.c
> +++ linux-2.6.17/kernel/module.c
> @@ -1935,7 +1935,7 @@ struct module *module_get_kallsym(unsign
> if (symnum < mod->num_symtab) {
> *value = mod->symtab[symnum].st_value;
> *type = mod->symtab[symnum].st_info;
> - strncpy(namebuf,
> + strlcpy(namebuf,
> mod->strtab + mod->symtab[symnum].st_name,
> 127);
Just a minor point: you probably also want to change 127 to 128.
Unfortunately sizeof does not work here, despite the declaration.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2006-07-05 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-05 16:59 NULL terminate over-long /proc/kallsyms symbols Andreas Gruenbacher
2006-07-05 17:03 ` Daniel Bonekeeper
2006-07-05 17:06 ` Christoph Hellwig
2006-07-06 18:00 ` Avi Kivity
2006-07-05 17:13 ` Andreas Schwab [this message]
2006-07-05 19:34 ` Andrew Morton
2006-07-05 19:42 ` Andreas Gruenbacher
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=jewtasm0v7.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=agruen@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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