The following issues were found
src/mail/ngx_mail_auth_http_module.c
3 issues
Line: 225
Column: 41
CWE codes:
120
20
ctx->handler = ngx_mail_auth_http_ignore_status_line;
ngx_add_timer(ctx->peer.connection->read, ahcf->timeout);
ngx_add_timer(ctx->peer.connection->write, ahcf->timeout);
if (rc == NGX_OK) {
ngx_mail_auth_http_write_handler(ctx->peer.connection->write);
return;
Reported by FlawFinder.
src/core/ngx_string.h
3 issues
Line: 106
Column: 42
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
* gcc3 compiles memcpy(d, s, 4) to the inline "mov"es.
* icc8 compile memcpy(d, s, 4) to the inline "mov"es or XMM moves.
*/
#define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n)
#define ngx_cpymem(dst, src, n) (((u_char *) memcpy(dst, src, n)) + (n))
#endif
Reported by FlawFinder.
Line: 107
Column: 48
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
* icc8 compile memcpy(d, s, 4) to the inline "mov"es or XMM moves.
*/
#define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n)
#define ngx_cpymem(dst, src, n) (((u_char *) memcpy(dst, src, n)) + (n))
#endif
#if ( __INTEL_COMPILER >= 800 )
Reported by FlawFinder.
Line: 61
Column: 29
CWE codes:
126
#define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2)
#define ngx_strlen(s) strlen((const char *) s)
size_t ngx_strnlen(u_char *p, size_t n);
#define ngx_strchr(s1, c) strchr((const char *) s1, (int) c)
Reported by FlawFinder.
src/os/win32/ngx_files.h
3 issues
Line: 72
Column: 73
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
#define NGX_FILE_ERROR 0
ngx_fd_t ngx_open_file(u_char *name, u_long mode, u_long create, u_long access);
#define ngx_open_file_n "CreateFile()"
#define NGX_FILE_RDONLY GENERIC_READ
#define NGX_FILE_WRONLY GENERIC_WRITE
#define NGX_FILE_RDWR GENERIC_READ|GENERIC_WRITE
Reported by FlawFinder.
Line: 89
Column: 45
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
#define NGX_FILE_OWNER_ACCESS 0
#define ngx_open_tempfile(name, persistent, access) \
CreateFile((const char *) name, \
GENERIC_READ|GENERIC_WRITE, \
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, \
NULL, \
CREATE_NEW, \
Reported by FlawFinder.
Line: 197
Column: 30
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
#define ngx_close_dir_n "FindClose()"
#define ngx_create_dir(name, access) CreateDirectory((const char *) name, NULL)
#define ngx_create_dir_n "CreateDirectory()"
#define ngx_delete_dir(name) RemoveDirectory((const char *) name)
#define ngx_delete_dir_n "RemoveDirectory()"
Reported by FlawFinder.
src/stream/ngx_stream_core_module.c
3 issues
Line: 272
Column: 38
CWE codes:
120
20
}
if (rc == NGX_AGAIN) {
if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
ngx_stream_finalize_session(s, NGX_STREAM_INTERNAL_SERVER_ERROR);
return NGX_OK;
}
if (!c->read->timer_set) {
Reported by FlawFinder.
src/stream/ngx_stream_ssl_module.c
2 issues
Line: 402
Column: 26
CWE codes:
120
20
if (rc == NGX_AGAIN) {
sslcf = ngx_stream_get_module_srv_conf(s, ngx_stream_ssl_module);
ngx_add_timer(c->read, sslcf->handshake_timeout);
c->ssl->handler = ngx_stream_ssl_handshake_handler;
return NGX_AGAIN;
}
Reported by FlawFinder.
src/core/ngx_conf_file.c
2 issues
Line: 90
CWE codes:
562
conf_file.file.name.data = NULL;
conf_file.line = 0;
cf->conf_file = &conf_file;
cf->conf_file->buffer = &b;
rv = ngx_conf_parse(cf, NULL);
cf->conf_file = NULL;
Reported by Cppcheck.
Line: 191
CWE codes:
562
prev = cf->conf_file;
cf->conf_file = &conf_file;
if (ngx_fd_info(fd, &cf->conf_file->file.info) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,
ngx_fd_info_n " \"%s\" failed", filename->data);
}
Reported by Cppcheck.
src/core/ngx_connection.h
2 issues
Line: 57
Column: 25
CWE codes:
362
ngx_uint_t worker;
unsigned open:1;
unsigned remain:1;
unsigned ignore:1;
unsigned bound:1; /* already bound */
unsigned inherited:1; /* inherited from previous process */
Reported by FlawFinder.
src/core/ngx_resolver.c
2 issues
src/event/ngx_event.c
2 issues
src/event/ngx_event_openssl_stapling.c
2 issues
Line: 857
Column: 38
CWE codes:
120
20
ngx_ssl_ocsp_conf_t *ocf;
if (c->ssl->in_ocsp) {
if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
return NGX_ERROR;
}
if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
return NGX_ERROR;
Reported by FlawFinder.
Line: 1540
Column: 45
CWE codes:
120
20
ctx->process = ngx_ssl_ocsp_process_status_line;
if (ctx->timeout) {
ngx_add_timer(ctx->peer.connection->read, ctx->timeout);
ngx_add_timer(ctx->peer.connection->write, ctx->timeout);
}
if (rc == NGX_OK) {
ngx_ssl_ocsp_write_handler(ctx->peer.connection->write);
Reported by FlawFinder.