The following issues were found
deps/w32-pthreads/tests/cleanup1.c
1 issues
Line: 159
Column: 3
CWE codes:
Suggestion:
Use InitializeCriticalSectionAndSpinCount instead
int i;
pthread_t t[NUMTHREADS + 1];
InitializeCriticalSection(&pop_count.cs);
assert((t[0] = pthread_self()).p != NULL);
for (i = 1; i <= NUMTHREADS; i++)
{
Reported by FlawFinder.
deps/w32-pthreads/tests/cleanup2.c
1 issues
Line: 144
Column: 3
CWE codes:
Suggestion:
Use InitializeCriticalSectionAndSpinCount instead
int i;
pthread_t t[NUMTHREADS + 1];
InitializeCriticalSection(&pop_count.cs);
assert((t[0] = pthread_self()).p != NULL);
for (i = 1; i <= NUMTHREADS; i++)
{
Reported by FlawFinder.
deps/w32-pthreads/tests/cleanup3.c
1 issues
Line: 149
Column: 3
CWE codes:
Suggestion:
Use InitializeCriticalSectionAndSpinCount instead
int i;
pthread_t t[NUMTHREADS + 1];
InitializeCriticalSection(&pop_count.cs);
assert((t[0] = pthread_self()).p != NULL);
for (i = 1; i <= NUMTHREADS; i++)
{
Reported by FlawFinder.
deps/w32-pthreads/tests/condvar1_1.c
1 issues
Line: 99
Column: 10
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
}
j = NUM_CV;
(void) srand((unsigned)time(NULL));
do
{
i = (NUM_CV - 1) * rand() / RAND_MAX;
if (cv[i] != NULL)
Reported by FlawFinder.
deps/w32-pthreads/tests/condvar1_2.c
1 issues
Line: 103
Column: 14
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
}
j = NUM_CV;
(void) srand((unsigned)time(NULL));
/* Traverse the list asynchronously. */
assert(pthread_create(&t, NULL, pthread_timechange_handler_np, NULL) == 0);
do
Reported by FlawFinder.
deps/w32-pthreads/tests/exception2.c
1 issues
Line: 128
Column: 16
CWE codes:
78
Suggestion:
try using a library call that implements the same functionality if available
printf("You should see an \"abnormal termination\" message\n");
fflush(stdout);
result = system("exception2.exe die");
exit(0);
}
assert((mt = pthread_self()).p != NULL);
Reported by FlawFinder.
deps/w32-pthreads/tests/exception3.c
1 issues
Line: 106
Column: 18
CWE codes:
362
caught++;
#if 0
{
FILE * fp = fopen("pthread.log", "a");
fprintf(fp, "Caught = %d\n", caught);
fclose(fp);
}
#endif
assert(pthread_mutex_unlock(&caughtLock) == 0);
Reported by FlawFinder.
deps/w32-pthreads/tests/loadfree.c
1 issues
Line: 63
Column: 19
CWE codes:
829
20
Suggestion:
Use LoadLibraryEx with one of the search flags, or call SetSearchPathMode to use a safe search path, or pass a full path to the library
int main() {
HINSTANCE hinst;
assert((hinst = LoadLibrary("pthread")) != (HINSTANCE) 0);
Sleep(100);
FreeLibrary(hinst);
return 0;
Reported by FlawFinder.
deps/w32-pthreads/tests/tryentercs2.c
1 issues
Line: 68
Column: 17
CWE codes:
829
20
Suggestion:
Use LoadLibraryEx with one of the search flags, or call SetSearchPathMode to use a safe search path, or pass a full path to the library
/*
* Load KERNEL32 and try to get address of TryEnterCriticalSection
*/
_h_kernel32 = LoadLibrary(TEXT("KERNEL32.DLL"));
_try_enter_critical_section =
(BOOL (PT_STDCALL *)(LPCRITICAL_SECTION))
GetProcAddress(_h_kernel32,
(LPCSTR) "TryEnterCriticalSection");
Reported by FlawFinder.
libobs-d3d11/d3d11-samplerstate.cpp
1 issues
Line: 85
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
sd.MaxLOD = FLT_MAX;
vec4_from_rgba(&v4, info->border_color);
memcpy(sd.BorderColor, v4.ptr, sizeof(v4));
hr = device->device->CreateSamplerState(&sd, state.Assign());
if (FAILED(hr))
throw HRError("Failed to create sampler state", hr);
}
Reported by FlawFinder.