Re: [chrony-dev] Alleged out of bounds read in cmdmon.c

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Tue, Aug 05, 2014 at 02:36:58PM +0200, Holger Hoffstätte wrote:
> On 08/05/14 14:19, Miroslav Lichvar wrote:
> > LOG_FATAL calls exit(), it doesn't return. We could add "return 0" there
> > to remove the warning, but there are still other 6 in the report.
> 
> Ha! I thought so, looked into logging.h and .. apparently missed the exit(). :(
> Maybe __attribute__ ((noreturn)) will do the trick? IMHO it was made for that purpose.

That would probably work, but there is a problem that LOG_Message used
in the LOG_FATAL macro doesn't always exit, only when the first
argument is LOGS_FATAL.

I tried to move the exit() call from LOG_Message to the LOG_FATAL
macro and clang seems to get the hint. Surprisingly (for me anyway),
it also made the chronyd binary slightly smaller, so it looks like a
win-win :).

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/