Task #118716 - fixed.err
back to task #118716download
Error: SHELLCHECK_WARNING:
/usr/bin/brltty-config.sh:66:4: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 64| local PACKAGE_TARNAME='brltty'
# 65| local PACKAGE_NAME='BRLTTY'
# 66|-> local PACKAGE_VERSION='6.8'
# 67| local PACKAGE_URL='https://brltty.app/'
# 68| local PACKAGE_BUGREPORT='BRLTTY@brltty.app'
Error: SHELLCHECK_WARNING:
/usr/bin/brltty-config.sh:82:4: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 80|
# 81| local api_version='0.8'
# 82|-> local api_release='0.8.7'
# 83| local api_authkeyfile='brlapi.key'
# 84|
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:248: error[memleakOnRealloc]: Common realloc mistake: 'curRows' nulled but not freed upon failure
# 246| static void addRows(long pos, long num) {
# 247| curNumRows += num;
# 248|-> curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 249| curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 250| memmove(curRows +pos+num,curRows +pos,(curNumRows-(pos+num))*sizeof(*curRows));
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:249: error[memleakOnRealloc]: Common realloc mistake: 'curRowLengths' nulled but not freed upon failure
# 247| curNumRows += num;
# 248| curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 249|-> curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 250| memmove(curRows +pos+num,curRows +pos,(curNumRows-(pos+num))*sizeof(*curRows));
# 251| memmove(curRowLengths+pos+num,curRowLengths+pos,(curNumRows-(pos+num))*sizeof(*curRowLengths));
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:261: error[memleakOnRealloc]: Common realloc mistake: 'curRows' nulled but not freed upon failure
# 259| memmove(curRowLengths+pos,curRowLengths+pos+num,(curNumRows-(pos+num))*sizeof(*curRowLengths));
# 260| curNumRows -= num;
# 261|-> curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 262| curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 263| }
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:262: error[memleakOnRealloc]: Common realloc mistake: 'curRowLengths' nulled but not freed upon failure
# 260| curNumRows -= num;
# 261| curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 262|-> curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 263| }
# 264|
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:788: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
# 786| }
# 787| ret = malloc(sizeof(*ret) * count);
# 788|-> memcpy(ret, states, sizeof(*ret) * count);
# 789|
# 790| out:
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1336: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: a2Watch
# 1334| {
# 1335| struct a2Watch *a2Watch = calloc(1, sizeof(*a2Watch));
# 1336|-> a2Watch->watch = watch;
# 1337| int flags = dbus_watch_get_flags(watch);
# 1338| if (dbus_watch_get_enabled(watch))
Error: GCC_ANALYZER_WARNING (CWE-476):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1336:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a2Watch’
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1360:6: enter_function: entry to ‘a2WatchToggled’
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1363:8: branch_true: following ‘true’ branch...
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1364:7: branch_true: ...to here
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1364:7: call_function: calling ‘a2AddWatch’ from ‘a2WatchToggled’
# 1334| {
# 1335| struct a2Watch *a2Watch = calloc(1, sizeof(*a2Watch));
# 1336|-> a2Watch->watch = watch;
# 1337| int flags = dbus_watch_get_flags(watch);
# 1338| if (dbus_watch_get_enabled(watch))
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1403: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: a2Timeout
# 1401| {
# 1402| struct a2Timeout *a2Timeout = calloc(1, sizeof(*a2Timeout));
# 1403|-> a2Timeout->timeout = timeout;
# 1404| if (dbus_timeout_get_enabled(timeout))
# 1405| asyncNewRelativeAlarm(&a2Timeout->monitor, dbus_timeout_get_interval(timeout), a2ProcessTimeout, a2Timeout);
Error: GCC_ANALYZER_WARNING (CWE-476):
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1403:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a2Timeout’
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1419:6: enter_function: entry to ‘a2TimeoutToggled’
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1422:8: branch_true: following ‘true’ branch...
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1423:7: branch_true: ...to here
brltty-6.8/minimal/Drivers/Screen/AtSpi2/a2_screen.c:1423:7: call_function: calling ‘a2AddTimeout’ from ‘a2TimeoutToggled’
# 1401| {
# 1402| struct a2Timeout *a2Timeout = calloc(1, sizeof(*a2Timeout));
# 1403|-> a2Timeout->timeout = timeout;
# 1404| if (dbus_timeout_get_enabled(timeout))
# 1405| asyncNewRelativeAlarm(&a2Timeout->monitor, dbus_timeout_get_interval(timeout), a2ProcessTimeout, a2Timeout);
Error: CPPCHECK_WARNING (CWE-457):
brltty-6.8/minimal/Programs/brltty-lscmds.c:236: warning[uninitvar]: Uninitialized variables: commands.name, commands.description, commands.code, commands.isToggle, commands.isMotion, commands.isRow, commands.isVertical, commands.isHorizontal, commands.isPanning, commands.isInput, commands.isCharacter, commands.isBraille, commands.isKeyboard, commands.isRouting, commands.isColumn, commands.isOffset, commands.isRange
# 234| commands[index] = &commandTable[index];
# 235| }
# 236|-> qsort(commands, count, sizeof(commands[0]), compareCommands);
# 237|
# 238| for (int index=0; index<count; index+=1) {
Error: GCC_ANALYZER_WARNING (CWE-401):
brltty-6.8/minimal/Programs/brltty-lsinc.c:54:1: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
brltty-6.8/minimal/Programs/brltty-lsinc.c:49:12: acquire_memory: allocated here
brltty-6.8/minimal/Programs/brltty-lsinc.c:50:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
brltty-6.8/minimal/Programs/brltty-lsinc.c:51:10: branch_false: ...to here
brltty-6.8/minimal/Programs/brltty-lsinc.c:51:8: branch_false: following ‘false’ branch...
brltty-6.8/minimal/Programs/brltty-lsinc.c:52:5: branch_false: ...to here
brltty-6.8/minimal/Programs/brltty-lsinc.c:54:1: danger: ‘name’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 52| printf("%s\n", name);
# 53| }
# 54|-> }
# 55|
# 56| static DATA_CONDITION_TESTER(testConditionOperand) {
Error: GCC_ANALYZER_WARNING (CWE-457):
brltty-6.8/minimal/Programs/message.c:466:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*mgd.segments.first.start’
brltty-6.8/minimal/Programs/message.c:416:1: enter_function: entry to ‘presentMessage’
brltty-6.8/minimal/Programs/message.c:423:6: branch_true: following ‘true’ branch...
brltty-6.8/minimal/Programs/message.c:423:21: branch_true: ...to here
brltty-6.8/minimal/Programs/message.c:448:8: branch_false: following ‘false’ branch...
brltty-6.8/minimal/Programs/message.c:463:20: branch_false: ...to here
brltty-6.8/minimal/Programs/message.c:465:25: call_function: calling ‘makeSegments’ from ‘presentMessage’
brltty-6.8/minimal/Programs/message.c:465:25: return_function: returning to ‘presentMessage’ from ‘makeSegments’
brltty-6.8/minimal/Programs/message.c:466:27: danger: use of uninitialized value ‘*mgd.segments.first.start’ here
# 464| mgd.segments.current = mgd.segments.first = messageSegments;
# 465| mgd.segments.last = makeSegments(messageSegments, characters, characterCount, wordWrap);
# 466|-> mgd.clipboard.start = mgd.segments.first->start;
# 467|
# 468| int apiWasLinked = api.isServerLinked();
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/python3/Bindings/Python/bindings.c:146: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: descr
# 144|
# 145| descr = malloc(sizeof(*descr));
# 146|-> descr->callback = func;
# 147|
# 148| brlapi_descr = brlapi__watchParameter(handle, param, subparam, flags, brlapi_python_parameter_callback, descr, NULL, 0);
Error: GCC_ANALYZER_WARNING (CWE-476):
brltty-6.8/python3/Bindings/Python/bindings.c:146:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘descr’
brltty-6.8/python3/Bindings/Python/bindings.c:132:42: enter_function: entry to ‘brlapi_python_watchParameter’
brltty-6.8/python3/Bindings/Python/bindings.c:138:6: branch_false: following ‘false’ branch...
brltty-6.8/python3/Bindings/Python/bindings.c:143:3: call_function: inlined call to ‘Py_INCREF’ from ‘brlapi_python_watchParameter’
brltty-6.8/python3/Bindings/Python/bindings.c:145:11: branch_true: ...to here
brltty-6.8/python3/Bindings/Python/bindings.c:145:11: acquire_memory: this call could return NULL
brltty-6.8/python3/Bindings/Python/bindings.c:146:3: danger: ‘descr’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
# 144|
# 145| descr = malloc(sizeof(*descr));
# 146|-> descr->callback = func;
# 147|
# 148| brlapi_descr = brlapi__watchParameter(handle, param, subparam, flags, brlapi_python_parameter_callback, descr, NULL, 0);
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/python3/Bindings/Python/bindings.c:156: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: descr
# 154| }
# 155|
# 156|-> descr->brlapi_descr = brlapi_descr;
# 157|
# 158| return descr;
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:248: error[memleakOnRealloc]: Common realloc mistake: 'curRows' nulled but not freed upon failure
# 246| static void addRows(long pos, long num) {
# 247| curNumRows += num;
# 248|-> curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 249| curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 250| memmove(curRows +pos+num,curRows +pos,(curNumRows-(pos+num))*sizeof(*curRows));
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:249: error[memleakOnRealloc]: Common realloc mistake: 'curRowLengths' nulled but not freed upon failure
# 247| curNumRows += num;
# 248| curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 249|-> curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 250| memmove(curRows +pos+num,curRows +pos,(curNumRows-(pos+num))*sizeof(*curRows));
# 251| memmove(curRowLengths+pos+num,curRowLengths+pos,(curNumRows-(pos+num))*sizeof(*curRowLengths));
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:261: error[memleakOnRealloc]: Common realloc mistake: 'curRows' nulled but not freed upon failure
# 259| memmove(curRowLengths+pos,curRowLengths+pos+num,(curNumRows-(pos+num))*sizeof(*curRowLengths));
# 260| curNumRows -= num;
# 261|-> curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 262| curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 263| }
Error: CPPCHECK_WARNING (CWE-401):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:262: error[memleakOnRealloc]: Common realloc mistake: 'curRowLengths' nulled but not freed upon failure
# 260| curNumRows -= num;
# 261| curRows = realloc(curRows,curNumRows*sizeof(*curRows));
# 262|-> curRowLengths = realloc(curRowLengths,curNumRows*sizeof(*curRowLengths));
# 263| }
# 264|
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:788: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
# 786| }
# 787| ret = malloc(sizeof(*ret) * count);
# 788|-> memcpy(ret, states, sizeof(*ret) * count);
# 789|
# 790| out:
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1336: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: a2Watch
# 1334| {
# 1335| struct a2Watch *a2Watch = calloc(1, sizeof(*a2Watch));
# 1336|-> a2Watch->watch = watch;
# 1337| int flags = dbus_watch_get_flags(watch);
# 1338| if (dbus_watch_get_enabled(watch))
Error: GCC_ANALYZER_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1336:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a2Watch’
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1360:6: enter_function: entry to ‘a2WatchToggled’
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1363:8: branch_true: following ‘true’ branch...
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1364:7: branch_true: ...to here
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1364:7: call_function: calling ‘a2AddWatch’ from ‘a2WatchToggled’
# 1334| {
# 1335| struct a2Watch *a2Watch = calloc(1, sizeof(*a2Watch));
# 1336|-> a2Watch->watch = watch;
# 1337| int flags = dbus_watch_get_flags(watch);
# 1338| if (dbus_watch_get_enabled(watch))
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1403: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: a2Timeout
# 1401| {
# 1402| struct a2Timeout *a2Timeout = calloc(1, sizeof(*a2Timeout));
# 1403|-> a2Timeout->timeout = timeout;
# 1404| if (dbus_timeout_get_enabled(timeout))
# 1405| asyncNewRelativeAlarm(&a2Timeout->monitor, dbus_timeout_get_interval(timeout), a2ProcessTimeout, a2Timeout);
Error: GCC_ANALYZER_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1403:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a2Timeout’
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1419:6: enter_function: entry to ‘a2TimeoutToggled’
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1422:8: branch_true: following ‘true’ branch...
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1423:7: branch_true: ...to here
brltty-6.8/python3/Drivers/Screen/AtSpi2/a2_screen.c:1423:7: call_function: calling ‘a2AddTimeout’ from ‘a2TimeoutToggled’
# 1401| {
# 1402| struct a2Timeout *a2Timeout = calloc(1, sizeof(*a2Timeout));
# 1403|-> a2Timeout->timeout = timeout;
# 1404| if (dbus_timeout_get_enabled(timeout))
# 1405| asyncNewRelativeAlarm(&a2Timeout->monitor, dbus_timeout_get_interval(timeout), a2ProcessTimeout, a2Timeout);
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Speech/SpeechDispatcher/speech.c:166: error[nullPointer]: Null pointer dereference: error_message
# 164| char **error_message = NULL;
# 165| if (!(connectionHandle = spd_open2("brltty", "main", NULL, SPD_MODE_THREADED, NULL, autospawn, error_message))) {
# 166|-> logMessage(LOG_ERR, "speech dispatcher open failure: %s",*error_message);
# 167| free(*error_message);
# 168| return 0;
Error: GCC_ANALYZER_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Speech/SpeechDispatcher/speech.c:166:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
brltty-6.8/python3/Drivers/Speech/SpeechDispatcher/speech.c:165:8: branch_true: following ‘true’ branch...
brltty-6.8/python3/Drivers/Speech/SpeechDispatcher/speech.c:166:7: branch_true: ...to here
brltty-6.8/python3/Drivers/Speech/SpeechDispatcher/speech.c:166:7: danger: dereference of NULL ‘0’
# 164| char **error_message = NULL;
# 165| if (!(connectionHandle = spd_open2("brltty", "main", NULL, SPD_MODE_THREADED, NULL, autospawn, error_message))) {
# 166|-> logMessage(LOG_ERR, "speech dispatcher open failure: %s",*error_message);
# 167| free(*error_message);
# 168| return 0;
Error: CPPCHECK_WARNING (CWE-476):
brltty-6.8/python3/Drivers/Speech/SpeechDispatcher/speech.c:167: error[nullPointer]: Null pointer dereference: error_message
# 165| if (!(connectionHandle = spd_open2("brltty", "main", NULL, SPD_MODE_THREADED, NULL, autospawn, error_message))) {
# 166| logMessage(LOG_ERR, "speech dispatcher open failure: %s",*error_message);
# 167|-> free(*error_message);
# 168| return 0;
# 169| }
Error: CPPCHECK_WARNING (CWE-457):
brltty-6.8/python3/Programs/brltty-lscmds.c:236: warning[uninitvar]: Uninitialized variables: commands.name, commands.description, commands.code, commands.isToggle, commands.isMotion, commands.isRow, commands.isVertical, commands.isHorizontal, commands.isPanning, commands.isInput, commands.isCharacter, commands.isBraille, commands.isKeyboard, commands.isRouting, commands.isColumn, commands.isOffset, commands.isRange
# 234| commands[index] = &commandTable[index];
# 235| }
# 236|-> qsort(commands, count, sizeof(commands[0]), compareCommands);
# 237|
# 238| for (int index=0; index<count; index+=1) {
Error: GCC_ANALYZER_WARNING (CWE-401):
brltty-6.8/python3/Programs/brltty-lsinc.c:54:1: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
brltty-6.8/python3/Programs/brltty-lsinc.c:49:12: acquire_memory: allocated here
brltty-6.8/python3/Programs/brltty-lsinc.c:50:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
brltty-6.8/python3/Programs/brltty-lsinc.c:51:10: branch_false: ...to here
brltty-6.8/python3/Programs/brltty-lsinc.c:51:8: branch_false: following ‘false’ branch...
brltty-6.8/python3/Programs/brltty-lsinc.c:52:5: branch_false: ...to here
brltty-6.8/python3/Programs/brltty-lsinc.c:54:1: danger: ‘name’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 52| printf("%s\n", name);
# 53| }
# 54|-> }
# 55|
# 56| static DATA_CONDITION_TESTER(testConditionOperand) {
Error: GCC_ANALYZER_WARNING (CWE-457):
brltty-6.8/python3/Programs/message.c:466:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*mgd.segments.first.start’
brltty-6.8/python3/Programs/message.c:416:1: enter_function: entry to ‘presentMessage’
brltty-6.8/python3/Programs/message.c:423:6: branch_true: following ‘true’ branch...
brltty-6.8/python3/Programs/message.c:423:21: branch_true: ...to here
brltty-6.8/python3/Programs/message.c:448:8: branch_false: following ‘false’ branch...
brltty-6.8/python3/Programs/message.c:463:20: branch_false: ...to here
brltty-6.8/python3/Programs/message.c:465:25: call_function: calling ‘makeSegments’ from ‘presentMessage’
brltty-6.8/python3/Programs/message.c:465:25: return_function: returning to ‘presentMessage’ from ‘makeSegments’
brltty-6.8/python3/Programs/message.c:466:27: danger: use of uninitialized value ‘*mgd.segments.first.start’ here
# 464| mgd.segments.current = mgd.segments.first = messageSegments;
# 465| mgd.segments.last = makeSegments(messageSegments, characters, characterCount, wordWrap);
# 466|-> mgd.clipboard.start = mgd.segments.first->start;
# 467|
# 468| int apiWasLinked = api.isServerLinked();