lkml.org 
[lkml]   [2012]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mpi: Avoid using freed pointer in mpi_lshift_limbs()
On Tue, 13 Mar 2012, Kasatkin, Dmitry wrote:

> On Thu, Mar 1, 2012 at 11:33 PM, Jesper Juhl <jj@chaosbits.net> wrote:
> >
> > Ping?
> >
> > On Mon, 6 Feb 2012, Jesper Juhl wrote:
> >
> >> At the start of the function we assign 'a->d' to 'ap'. Then we use the
> >> RESIZE_IF_NEEDED macro on 'a' - this may free 'a->d' and replace it
> >> with newly allocaetd storage. In that case, we'll be operating on
> >> freed memory further down in the function when we index into 'ap[]'.
> >> Since we don't actually need 'ap' until after the use of the
> >> RESIZE_IF_NEEDED macro we can just delay the assignment to it until
> >> after we've potentially resized, thus avoiding the issue.
> >>
> >> While I was there anyway I also changed the integer variable 'n' to be
> >> const. It might as well be since we only assign to it once and use it
> >> as a constant, and then the compiler will tell us if we ever assign to
> >> it in the future.
> >>
> >> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> >> ---
[...]
> Hello,
>
> I was travelling last week.
> I will review the patch now..
>

:-) Thanks. No rush, I'd just like to see the fix included at some point
if you agree that it is correct - just wondered at the "~1 month no
response".


> Thanks,
> Dmitry
>

--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.



\
 
 \ /
  Last update: 2012-03-15 01:37    [W:2.681 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site