Re: PATCH: anti memleak part 1



> > -  pw = balsa_app.smtp_certificate_passphrase;
> > -  len = strlen (pw);
> > +  len = strlen (balsa_app.smtp_certificate_passphrase);
> > +
> >    if (len + 1 > buflen)
> >      return 0;
> > -  strcpy (buf, pw);
> > +
> > +  buf = balsa_app.smtp_certificate_passphrase;
> >    return len;
> >  }
> >  #endif
> 
> I don't think this one works.  `tlsinteract' would have to be called 
> with `char **buf_p' instead of `char *buf', and then  you could end 
> with `*buf_p = balsa_app.smtp_certificate_passphrase;'  In your 
> suggested code, `buf' is changed on the stack, but nothing is changed 
> in the caller's frame.
> 
> If you *really* wanted to get rid of `char *pw', you could finish up 
> with `strcpy (buf, balsa_app.smtp_certificate_passphrase);'

mkay, thanks for verification.. the other code seem to be still
valid...

-- 
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science
E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]