sslsplit icon indicating copy to clipboard operation
sslsplit copied to clipboard

Missing error checks about function time(), gmtime() and strftime()

Open lc3412 opened this issue 5 years ago • 2 comments

Hi,

I notice that funtion time(), gmtime() and strftime() are frequently used in the log.c. Here is an example of the usages, as shown in the following code, function time(), gmtime() and strftime() are do the handling actions when errors occur. So I think error handling towards these functions might be preferred. https://github.com/droe/sslsplit/blob/9bac829b7f62252a8958b60c96f8f4b11125fcc9/log.c#L634-L650

==============================================================================

However, in the other call sites of the same file, there exists several missing checks of function time(), gmtime() or strftime(). For example, as shown in the following code: https://github.com/droe/sslsplit/blob/9bac829b7f62252a8958b60c96f8f4b11125fcc9/log.c#L563-L565

lc3412 avatar Jul 17 '20 13:07 lc3412

Yes, you can find such cases where we don't check the return values of system calls. Perhaps we should check them too.

sonertari avatar Jul 22 '20 12:07 sonertari

Thank you very much for your patience in responding me about the Error Handling Proposals. As you said, other cases about missing error code checks are also found. However, sometimes it is confusing to figure out whether such cases are necessary to be repaired. Especially, as shown above, in the same project, some cases are handled properly but others are not.

lc3412 avatar Aug 04 '20 13:08 lc3412