Description
Hello! I was analyzing Nginx modules with the Svace static analyzer. It has found an inconsistency code at the following sections of the code:
nginx-http-auth-digest/ngx_http_auth_digest_module.c
Lines 1227 to 1247 in 5a2cae4
and
nginx-http-auth-digest/ngx_http_auth_digest_module.c
Lines 1286 to 1308 in 5a2cae4
In both methods the result value dropnode
of method invocation ngx_array_push
is dereferenced without checking for NULL:
and
Here's the source code for function ngx_array_push
:
Note that this function can return NULL. Therefore, when using it, it is important to check the result for NULL in order to avoid possible errors. And as a rule, such check is performed in other modules that use this function.
What do you think about adding the NULL checks?
Found by Linux Verification Center (linuxtesting.org) with SVACE.