From: Arjan van de Ven <arjanv@redhat.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: marcelo@contectiva.com.br
Subject: Re: [PATCH] PATCH: ibm hot plug driver fix
Date: 30 Apr 2003 14:07:08 +0200 [thread overview]
Message-ID: <1051704428.1404.11.camel@laptop.fenrus.com> (raw)
In-Reply-To: <200304012105.h31L5ep10931@hera.kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]
On Tue, 2003-04-01 at 21:30, Linux Kernel Mailing List wrote:
> # This patch includes the following deltas:
> # ChangeSet 1.1044 -> 1.1045
> # drivers/hotplug/ibmphp_ebda.c 1.6 -> 1.7
> #
>
> ibmphp_ebda.c | 25 ++++++++++++++++++++++---
> 1 files changed, 22 insertions(+), 3 deletions(-)
>
>
> diff -Nru a/drivers/hotplug/ibmphp_ebda.c b/drivers/hotplug/ibmphp_ebda.c
> --- a/drivers/hotplug/ibmphp_ebda.c Tue Apr 1 13:05:41 2003
> +++ b/drivers/hotplug/ibmphp_ebda.c Tue Apr 1 13:05:41 2003
> @@ -608,13 +608,20 @@
> return str;
> default:
> //2 digits number
> + str1 = (char *) kmalloc (2, GFP_KERNEL);
> + if (!str1) {
> + break;
> + }
> + memset (str, 0, 3);
> *str1 = (char)(bit + 48);
> strncpy (str, str1, 1);
> memset (str1, 0, 3);
> *str1 = (char)((var % 10) + 48);
> strcat (str, str1);
> + kfree(str1);
> return str;
> - }
> + }
> + kfree(str);
> return NULL;
> }
ehm I'd suggest backing out this change. Not only do we have snprintf
nowadays, it also corrupts memory by memsetting stuff bigger than it
allocated....
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
parent reply other threads:[~2003-04-30 11:54 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200304012105.h31L5ep10931@hera.kernel.org>]
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=1051704428.1404.11.camel@laptop.fenrus.com \
--to=arjanv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@contectiva.com.br \
/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
all inboxes | Powered by JetHome®