This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use calloc (x, y) instead malloc (x * y).
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 25 Oct 2013 14:26:29 +0530
- Subject: Re: [PATCH] Use calloc (x, y) instead malloc (x * y).
- Authentication-results: sourceware.org; auth=none
- References: <20131025084008 dot GA17443 at domone>
On Fri, Oct 25, 2013 at 10:40:08AM +0200, OndÅej BÃlka wrote:
> Hi,
>
> As there were several bugs with possible overflows in malloc calculation
> we should try to prevent these. A simple heuristic is to use following
> cocinelle patch:
>
> @@ expression e1, e2; @@
>
> - malloc(e1 * e2)
> + calloc(e1, e2)
>
> To handle easy case. OK to commit?
>
> ./ChangeLog:
>
Please write correct ChangeLog entries, with entries for all functions
you touch and not just for the files. If you think it is a waste of
time, I'll agree with you, but since we don't have consensus on
getting rid of it yet, this needs to be followed.
Siddhesh