Re: RFC: [PATCH] Portability by avoiding PATH_MAX
Svante Signell <[email protected]> Thu, 08 May 2014 13:55:58 +0200
| Newsgroups | gmane.comp.db.rrdtool.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 2014-05-08 at 10:18 +0100, Steven Hartland wrote: > ----- Original Message ----- > From: "Svante Signell" <[email protected]> > To: "Steven Hartland" <[email protected]> > Cc: "rrdtool dev list" <[email protected]> > Sent: Thursday, May 08, 2014 6:18 AM > Subject: Re: [rrd-developers] RFC: [PATCH] Portability by avoiding PATH_MAX > > >> So you just malloced some memory, assigned the pointer to it then freed > >> the memory, so your now going to get a use after free and BOOM! > > > > This is of course wrong, thanks! You see the reason for having tests > > together with valgrind to find out these problems. Did you find more? > > Obviously this means that any calls to get_abs_path need reworking in the > patch. Yes, it might be so that the calling functions should do freeing memory allocated by get_abs_path, as in the example code I sent. I'll submit modified patch(es) in due time! > I've not had time to go through it in detail but looks like the journal_dir > / realpath changes also have issues. You can see that there are still FIXMEs in the code, they have to be removed when a proper solution/verification is at hand... > Also there's some formatting issues with tabs instead of spacing. > > Regards > Steve > Really needs a proper review as there's lots of potential for issues with > this. Thanks, this is what I wanted, a review. And I'll submit to the Hurd developers for review too before creating a pull request.