Re: [chrony-dev] [sdl-chrony] DEREF_OF_NULL.RET.STAT in UTI_OpenFile function

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


On Tue, Oct 10, 2023 at 09:36:45PM +0300, Елена Быханова wrote:
> While analyzing the program code, we found the following: DEREF_OF_NULL in conf.c . 
> Return value of a function 'UTI_OpenFile' is dereferenced at conf.c:515 without checking for NULL . 

> The only difference between these cases is the register of the transmitted value. However, the research did not reveal any reasons for skipping the check in the case of uppercase letters . 

The reason is explained in util.h:

   The following modes are supported (if the mode is an uppercase character,
   errors are fatal):

That is, with an uppercase mode the function doesn't return NULL. If
the file cannot be opened, the process is terminated instead. There is
no need to check the return value.

-- 
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/