sdl2-compat-2.32.54-1.fc43

List of Findings

Error: CPPCHECK_WARNING (CWE-476): [#def1]
sdl2-compat-release-2.32.54/include/SDL2/SDL_rect.h:130: warning[nullPointer]: Possible null pointer dereference: b
#  128|   {
#  129|       return (a && b && (a->x == b->x) && (a->y == b->y) &&
#  130|->             (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
#  131|   }
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
sdl2-compat-release-2.32.54/src/sdl2_compat.c:9877:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘surface’
sdl2-compat-release-2.32.54/src/sdl2_compat.c:9872:1: enter_function: entry to ‘SDL_UnlockSurface_REAL’
sdl2-compat-release-2.32.54/src/sdl2_compat.c:9874:29: call_function: calling ‘Surface2to3’ from ‘SDL_UnlockSurface_REAL’
sdl2-compat-release-2.32.54/src/sdl2_compat.c:9874:29: return_function: returning to ‘SDL_UnlockSurface_REAL’ from ‘Surface2to3’
sdl2-compat-release-2.32.54/src/sdl2_compat.c:9877:10: danger: dereference of NULL ‘surface’
# 9875|   
# 9876|       /* Only perform an unlock if we are locked */
# 9877|->     if (!surface->locked || (--surface->locked > 0)) {
# 9878|           return;
# 9879|       }

Error: CPPCHECK_WARNING (CWE-758): [#def3]
sdl2-compat-release-2.32.54/src/test/SDL_test_common.c:887: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  885|       int count = 0;
#  886|       for (i = 1; i <= 32; ++i) {
#  887|->         const Uint32 flag = SDL_BUTTON(i);
#  888|           if ((flags & flag) == flag) {
#  889|               if (count > 0) {

Error: CPPCHECK_WARNING (CWE-758): [#def4]
sdl2-compat-release-2.32.54/src/test/SDL_test_common.c:1044: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1042|       count = 0;
# 1043|       for (i = 0; i < 8 * sizeof(info->flags); ++i) {
# 1044|->         Uint32 flag = (1 << i);
# 1045|           if (info->flags & flag) {
# 1046|               if (count > 0) {

Error: CPPCHECK_WARNING (CWE-758): [#def5]
sdl2-compat-release-2.32.54/test/testatomic.c:106: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  104|   enum
#  105|   {
#  106|->     CountTo_GreaterThanZero = CountTo > 0,
#  107|   };
#  108|   SDL_COMPILE_TIME_ASSERT(size, CountTo_GreaterThanZero); /* check for rollover */

Error: CPPCHECK_WARNING (CWE-758): [#def6]
sdl2-compat-release-2.32.54/test/testatomic.c:120: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  118|   static int SDLCALL adder(void *junk)
#  119|   {
#  120|->     unsigned long N = NInter;
#  121|       SDL_Log("Thread subtracting %d %lu times\n", CountInc, N);
#  122|       while (N--) {

Error: CPPCHECK_WARNING (CWE-758): [#def7]
sdl2-compat-release-2.32.54/test/testatomic.c:184: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  182|   
#  183|       SDL_Log("Verify maximum value\n");
#  184|->     SDL_AtomicSet(&good, CountTo);
#  185|       v = SDL_AtomicGet(&good);
#  186|       SDL_assert(v == CountTo);

Error: CPPCHECK_WARNING (CWE-758): [#def8]
sdl2-compat-release-2.32.54/test/testatomic.c:186: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  184|       SDL_AtomicSet(&good, CountTo);
#  185|       v = SDL_AtomicGet(&good);
#  186|->     SDL_assert(v == CountTo);
#  187|   
#  188|       SDL_Log("Test compare and exchange\n");

Error: CPPCHECK_WARNING (CWE-758): [#def9]
sdl2-compat-release-2.32.54/test/testatomic.c:193: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  191|       SDL_assert(!b); /* no swap since CountTo!=500 */
#  192|       v = SDL_AtomicGet(&good);
#  193|->     SDL_assert(v == CountTo); /* ensure no swap */
#  194|   
#  195|       b = SDL_AtomicCAS(&good, CountTo, 44);

Error: CPPCHECK_WARNING (CWE-758): [#def10]
sdl2-compat-release-2.32.54/test/testatomic.c:195: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  193|       SDL_assert(v == CountTo); /* ensure no swap */
#  194|   
#  195|->     b = SDL_AtomicCAS(&good, CountTo, 44);
#  196|       SDL_assert(!!b); /* will swap */
#  197|       v = SDL_AtomicGet(&good);

Error: CPPCHECK_WARNING (CWE-758): [#def11]
sdl2-compat-release-2.32.54/test/testatomic.c:230: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  228|   
#  229|       SDL_Log("Reset before count down test\n");
#  230|->     SDL_AtomicSet(&good, CountTo);
#  231|       v = SDL_AtomicGet(&good);
#  232|       SDL_assert(v == CountTo);

Error: CPPCHECK_WARNING (CWE-758): [#def12]
sdl2-compat-release-2.32.54/test/testatomic.c:232: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  230|       SDL_AtomicSet(&good, CountTo);
#  231|       v = SDL_AtomicGet(&good);
#  232|->     SDL_assert(v == CountTo);
#  233|   
#  234|       bad = CountTo;

Error: CPPCHECK_WARNING (CWE-758): [#def13]
sdl2-compat-release-2.32.54/test/testatomic.c:234: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  232|       SDL_assert(v == CountTo);
#  233|   
#  234|->     bad = CountTo;
#  235|       SDL_assert(bad == CountTo);
#  236|   

Error: CPPCHECK_WARNING (CWE-758): [#def14]
sdl2-compat-release-2.32.54/test/testatomic.c:235: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  233|   
#  234|       bad = CountTo;
#  235|->     SDL_assert(bad == CountTo);
#  236|   
#  237|       SDL_Log("Counting down from %d, Expect %d remaining\n", CountTo, Expect);

Error: CPPCHECK_WARNING (CWE-758): [#def15]
sdl2-compat-release-2.32.54/test/testatomic.c:237: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  235|       SDL_assert(bad == CountTo);
#  236|   
#  237|->     SDL_Log("Counting down from %d, Expect %d remaining\n", CountTo, Expect);
#  238|       runAdder();
#  239|   

Error: CPPCHECK_WARNING (CWE-758): [#def16]
sdl2-compat-release-2.32.54/test/testatomic.c:242: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  240|       v = SDL_AtomicGet(&good);
#  241|       SDL_Log("Atomic %d Non-Atomic %d\n", v, bad);
#  242|->     SDL_assert(v == Expect);
#  243|       /* We can't guarantee that bad != Expect, this would happen on a single core system, for example. */
#  244|       /*SDL_assert(bad != Expect);*/

Error: CPPCHECK_WARNING (CWE-457): [#def17]
sdl2-compat-release-2.32.54/test/testautomation_rect.c:744: error[uninitvar]: Uninitialized variable: &rectA
#  742|       intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, &result);
#  743|       SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
#  744|->     intersection = SDL_IntersectRect(&rectA, (SDL_Rect *)NULL, &result);
#  745|       SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL");
#  746|       intersection = SDL_IntersectRect(&rectA, &rectB, (SDL_Rect *)NULL);

Error: CPPCHECK_WARNING (CWE-457): [#def18]
sdl2-compat-release-2.32.54/test/testautomation_rect.c:998: error[uninitvar]: Uninitialized variable: &rectA
#  996|       intersection = SDL_HasIntersection((SDL_Rect *)NULL, &rectB);
#  997|       SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
#  998|->     intersection = SDL_HasIntersection(&rectA, (SDL_Rect *)NULL);
#  999|       SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL");
# 1000|       intersection = SDL_HasIntersection((SDL_Rect *)NULL, (SDL_Rect *)NULL);

Error: CPPCHECK_WARNING (CWE-457): [#def19]
sdl2-compat-release-2.32.54/test/testautomation_rect.c:1533: error[uninitvar]: Uninitialized variable: &rectA
# 1531|       SDL_UnionRect((SDL_Rect *)NULL, &rectB, &result);
# 1532|       SDLTest_AssertPass("Check that function returns when 1st parameter is NULL");
# 1533|->     SDL_UnionRect(&rectA, (SDL_Rect *)NULL, &result);
# 1534|       SDLTest_AssertPass("Check that function returns  when 2nd parameter is NULL");
# 1535|       SDL_UnionRect(&rectA, &rectB, (SDL_Rect *)NULL);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def20]
sdl2-compat-release-2.32.54/test/testlock.c:59:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
sdl2-compat-release-2.32.54/test/testlock.c:63:1: enter_function: entry to ‘Run’
sdl2-compat-release-2.32.54/test/testlock.c:65:8: branch_true: following ‘true’ branch...
sdl2-compat-release-2.32.54/test/testlock.c:66:15: branch_true: ...to here
sdl2-compat-release-2.32.54/test/testlock.c:49:6: enter_function: entry to ‘closemutex’
sdl2-compat-release-2.32.54/test/testlock.c:55:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
sdl2-compat-release-2.32.54/test/testlock.c:56:9: branch_true: ...to here
sdl2-compat-release-2.32.54/test/testlock.c:59:5: danger: call to ‘exit’ from within signal handler
#   57|       }
#   58|       SDL_DestroyMutex(mutex);
#   59|->     exit(sig);
#   60|   }
#   61|   

Error: GCC_ANALYZER_WARNING (CWE-479): [#def21]
sdl2-compat-release-2.32.54/test/testthread.c:34:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
sdl2-compat-release-2.32.54/test/testthread.c:88:5: enter_function: entry to ‘main’
sdl2-compat-release-2.32.54/test/testthread.c:93:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testthread.c:99:5: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testthread.c:121:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testthread.c:126:9: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testthread.c:126:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testthread.c:132:11: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testthread.c:139:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testthread.c:143:5: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testthread.c:79:1: enter_function: entry to ‘killed’
sdl2-compat-release-2.32.54/test/testthread.c:85:5: call_function: calling ‘quit’ from ‘killed’
#   32|       SDLTest_CommonQuit(state);
#   33|       SDL_Quit();
#   34|->     exit(rc);
#   35|   }
#   36|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def22]
sdl2-compat-release-2.32.54/test/testvulkan.c:712:9: warning[-Wanalyzer-jump-through-null]: jump through null pointer
sdl2-compat-release-2.32.54/test/testvulkan.c:1087:5: enter_function: entry to ‘main’
sdl2-compat-release-2.32.54/test/testvulkan.c:1100:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1105:5: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testvulkan.c:1108:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1121:5: call_function: calling ‘initVulkan’ from ‘main’
#  710|   {
#  711|       if (vulkanContext->swapchain) {
#  712|->         vkDestroySwapchainKHR(vulkanContext->device, vulkanContext->swapchain, NULL);
#  713|           vulkanContext->swapchain = VK_NULL_HANDLE;
#  714|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def23]
sdl2-compat-release-2.32.54/test/testvulkan.c:722:9: warning[-Wanalyzer-jump-through-null]: jump through null pointer
sdl2-compat-release-2.32.54/test/testvulkan.c:1087:5: enter_function: entry to ‘main’
sdl2-compat-release-2.32.54/test/testvulkan.c:1100:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1105:5: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testvulkan.c:1108:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1121:5: call_function: calling ‘initVulkan’ from ‘main’
#  720|   {
#  721|       if (vulkanContext->commandBuffers) {
#  722|->         vkFreeCommandBuffers(vulkanContext->device,
#  723|                                vulkanContext->commandPool,
#  724|                                vulkanContext->swapchainImageCount,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
sdl2-compat-release-2.32.54/test/testvulkan.c:734:9: warning[-Wanalyzer-jump-through-null]: jump through null pointer
sdl2-compat-release-2.32.54/test/testvulkan.c:1087:5: enter_function: entry to ‘main’
sdl2-compat-release-2.32.54/test/testvulkan.c:1100:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1105:5: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testvulkan.c:1108:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1121:5: call_function: calling ‘initVulkan’ from ‘main’
#  732|   {
#  733|       if (vulkanContext->commandPool) {
#  734|->         vkDestroyCommandPool(vulkanContext->device, vulkanContext->commandPool, NULL);
#  735|       }
#  736|       vulkanContext->commandPool = VK_NULL_HANDLE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def25]
sdl2-compat-release-2.32.54/test/testvulkan.c:814:9: warning[-Wanalyzer-jump-through-null]: jump through null pointer
sdl2-compat-release-2.32.54/test/testvulkan.c:1087:5: enter_function: entry to ‘main’
sdl2-compat-release-2.32.54/test/testvulkan.c:1100:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1105:5: branch_false: ...to here
sdl2-compat-release-2.32.54/test/testvulkan.c:1108:8: branch_false: following ‘false’ branch...
sdl2-compat-release-2.32.54/test/testvulkan.c:1121:5: call_function: calling ‘initVulkan’ from ‘main’
#  812|   
#  813|       for (i = 0; i < vulkanContext->swapchainImageCount; i++) {
#  814|->         vkDestroyFence(vulkanContext->device, vulkanContext->fences[i], NULL);
#  815|       }
#  816|       SDL_free(vulkanContext->fences);

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-41.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namesdl2-compat-2.32.54-1.fc43
store-results-to/tmp/tmpj_e4d1o_/sdl2-compat-2.32.54-1.fc43.tar.xz
time-created2025-04-25 15:36:21
time-finished2025-04-25 15:38:51
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpj_e4d1o_/sdl2-compat-2.32.54-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpj_e4d1o_/sdl2-compat-2.32.54-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9