The following issues were found
src/os/unix/ngx_posix_init.c
1 issues
Line: 92
Column: 5
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
#endif
tp = ngx_timeofday();
srandom(((unsigned) ngx_pid << 16) ^ tp->sec ^ tp->msec);
return NGX_OK;
}
Reported by FlawFinder.
src/os/unix/ngx_process.h
1 issues
Line: 74
Column: 28
CWE codes:
676
Suggestion:
Use nanosleep(2) or setitimer(2) instead
#if (NGX_HAVE_SCHED_YIELD)
#define ngx_sched_yield() sched_yield()
#else
#define ngx_sched_yield() usleep(1)
#endif
extern int ngx_argc;
extern char **ngx_argv;
Reported by FlawFinder.
src/stream/ngx_stream_geo_module.c
1 issues
Line: 439
CWE codes:
562
save = *cf;
cf->pool = pool;
cf->ctx = &ctx;
cf->handler = ngx_stream_geo;
cf->handler_conf = conf;
rv = ngx_conf_parse(cf, NULL);
Reported by Cppcheck.
src/os/unix/ngx_readv_chain.c
1 issues
Line: 23
Column: 14
CWE codes:
120
20
ngx_event_t *rev;
struct iovec *iov, iovs[NGX_IOVS_PREALLOCATE];
rev = c->read;
#if (NGX_HAVE_KQUEUE)
if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
Reported by FlawFinder.
src/os/unix/ngx_recv.c
1 issues
Line: 20
Column: 14
CWE codes:
120
20
ngx_err_t err;
ngx_event_t *rev;
rev = c->read;
#if (NGX_HAVE_KQUEUE)
if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
Reported by FlawFinder.
src/os/unix/ngx_shmem.c
1 issues
Line: 47
Column: 10
CWE codes:
362
{
ngx_fd_t fd;
fd = open("/dev/zero", O_RDWR);
if (fd == -1) {
ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
"open(\"/dev/zero\") failed");
return NGX_ERROR;
Reported by FlawFinder.
src/http/modules/ngx_http_fastcgi_module.c
1 issues
Line: 1755
Column: 47
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
pattern = flcf->catch_stderr->elts;
for (i = 0; i < flcf->catch_stderr->nelts; i++) {
if (ngx_strnstr(msg, (char *) pattern[i].data,
p - msg)
!= NULL)
{
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
Reported by FlawFinder.
src/core/ngx_string.c
1 issues
Line: 2096
Column: 12
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
ngx_debug_point();
}
return memcpy(dst, src, n);
}
#endif
Reported by FlawFinder.
src/os/unix/ngx_time.h
1 issues
Line: 62
Column: 38
CWE codes:
676
Suggestion:
Use nanosleep(2) or setitimer(2) instead
void ngx_libc_gmtime(time_t s, struct tm *tm);
#define ngx_gettimeofday(tp) (void) gettimeofday(tp, NULL);
#define ngx_msleep(ms) (void) usleep(ms * 1000)
#define ngx_sleep(s) (void) sleep(s)
#endif /* _NGX_TIME_H_INCLUDED_ */
Reported by FlawFinder.