Task #131037 - added.err
back to task #131037download
Error: SHELLCHECK_WARNING (CWE-138):
/usr/bin/gdiffmk:37:26: error[SC2145]: Argument mixes string and array. Use * or separate argument.
# 35| if test $# -gt 0
# 36| then
# 37|-> Diagnose "usage error: $@"
# 38| exec 2>&1
# 39| status=2
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:48:1: error[SC1073]: Couldn't parse this brace group. Fix to allow more checks.
# 46|
# 47| long_help()
# 48|-> {
# 49| printf <<EOF \
# 50| "USAGE:
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:50:1: warning[SC1078]: Did you forget to close this double quoted string?
# 48| {
# 49| printf <<EOF \
# 50|-> "USAGE:
# 51|
# 52| install-font.sh [-hHlscpn] [-P \033[4mdir\033[0m] [-C \033[4mdir\033[0m] [-F \033[4mfamily\033[0m] \
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:174:9: warning[SC1078]: Did you forget to close this double quoted string?
# 172|
# 173| case $1 in
# 174|-> -h | "")
# 175| show_usage
# 176| exit 0
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:187:47: warning[SC1078]: Did you forget to close this double quoted string?
# 185|
# 186| type fontforge > /dev/null 2>&1 || {
# 187|-> printf "fontforge not installed. Aborting.\n" >&2
# 188| exit 1
# 189| }
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:197:44: warning[SC1078]: Did you forget to close this double quoted string?
# 195| clean_tmp()
# 196| {
# 197|-> for i in ${tmp_dir}/*[!pe] ; do rm -f "$i" ; done # everything but .pe
# 198| for i in ${tmp_dir}/* ; do [ -L "$i" ] && rm "$i" ; done # symlinks
# 199| }
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:286:28: warning[SC1078]: Did you forget to close this double quoted string?
# 284|
# 285| Open(\$1);
# 286|-> Generate(\$fontname + ".pfa");
# 287| EOF
# 288| }
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:337:36: warning[SC1078]: Did you forget to close this double quoted string?
# 335| }
# 336|
# 337|-> printf "${font}\t${font}.${ext}\n" >> ${site_font_devps}/download
# 338|
# 339| printf "Done.\n"
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:348:57: error[SC1036]: '(' is invalid here. Did you forget to escape it?
# 346| else
# 347| printf \
# 348|-> "Make \033[33m${groff_font}\033[0m available to gropdf? (y/n; default = y) "
# 349| read gropdf
# 350| fi
Error: SHELLCHECK_WARNING:
/usr/share/doc/groff/examples/install-font.bash:348:57: error[SC1056]: Expected a '}'. If you have one, try a ; or \n in front of it.
# 346| else
# 347| printf \
# 348|-> "Make \033[33m${groff_font}\033[0m available to gropdf? (y/n; default = y) "
# 349| read gropdf
# 350| fi
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/doc/groff/examples/install-font.bash:348:57: error[SC1072]: Missing '}'. Fix any mentioned problems and try again.
# 346| else
# 347| printf \
# 348|-> "Make \033[33m${groff_font}\033[0m available to gropdf? (y/n; default = y) "
# 349| read gropdf
# 350| fi
Error: GCC_ANALYZER_WARNING:
groff-1.24.1/src/devices/xditview/xditview.c:379:5: warning[-Wanalyzer-overlapping-buffers]: overlapping buffers passed as arguments to ‘strncpy’
groff-1.24.1/src/devices/xditview/xditview.c:500:1: enter_function: entry to ‘RerasterizeAction’
groff-1.24.1/src/devices/xditview/xditview.c:512:5: call_function: calling ‘NewFile’ from ‘RerasterizeAction’
# 377| SelectPageNumber ("1");
# 378| size_t len = (sizeof current_file_name) - 1;
# 379|-> strncpy(current_file_name, name, len);
# 380| current_file_name[len] = '\0';
# 381| current_file = new_file;
Error: COMPILER_WARNING:
groff-1.24.1/src/libs/libdriver/printer.cpp:127:23: warning[-Wstringop-overflow=]: ‘__builtin_memset’ writing between 16 and 25769803768 bytes into a region of size 0 overflows the destination
# 127 | font_table[i] = 0 /* nullptr */;
# | ^
groff-1.24.1/src/libs/libdriver/printer.cpp:122:37: note: at offset [-8589934592, -8] into destination object of size [8, 17179869176] allocated by ‘operator new []’
# 122 | font_table = new font *[nfonts];
# | ^
# 125| font_table[i] = old_font_table[i];
# 126| for (i = old_nfonts; i < nfonts; i++)
# 127|-> font_table[i] = 0 /* nullptr */;
# 128| delete[] old_font_table;
# 129| }
Error: COMPILER_WARNING:
groff-1.24.1/src/libs/libdriver/printer.cpp: scope_hint: In member function ‘printer::load_font(int, char const*)’
groff-1.24.1/src/libs/libdriver/printer.cpp:127:23: warning[-Wstringop-overflow=]: ‘memset’ writing between 16 and 25769803768 bytes into a region of size 0 overflows the destination
# 127 | font_table[i] = 0 /* nullptr */;
# | ~~~~~~~~~~~~~~^~~
groff-1.24.1/src/libs/libdriver/printer.cpp:122:37: note: at offset [-8589934592, -8] into destination object of size [8, 17179869176] allocated by ‘operator new[](unsigned long)’
# 122 | font_table = new font *[nfonts];
# | ^
# 125| font_table[i] = old_font_table[i];
# 126| for (i = old_nfonts; i < nfonts; i++)
# 127|-> font_table[i] = 0 /* nullptr */;
# 128| delete[] old_font_table;
# 129| }
Error: CPPCHECK_WARNING (CWE-476):
groff-1.24.1/src/libs/libgroff/glyphuni.cpp:36: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
# 34|
# 35| declare_ptable(glyph_to_unicode_map)
# 36|-> implement_ptable(glyph_to_unicode_map)
# 37|
# 38| PTABLE(glyph_to_unicode_map) glyph_to_unicode_table;
Error: CPPCHECK_WARNING (CWE-190):
groff-1.24.1/src/roff/troff/hvunits.h:123: error[integerOverflow]: Signed integer underflow for expression '-1+(-2147483647-1)'.
# 121| vunits r;
# 122| // Why? Consider -(INT_MIN) in two's complement.
# 123|-> if (ckd_mul(&r.n, x.n, -1))
# 124| warning(WARN_RANGE, "integer multiplication saturated");
# 125| return r;
Error: CPPCHECK_WARNING (CWE-190):
groff-1.24.1/src/roff/troff/hvunits.h:241: error[integerOverflow]: Signed integer underflow for expression '-1+(-2147483647-1)'.
# 239| r = x;
# 240| // Why? Consider -(INT_MIN) in two's complement.
# 241|-> if (ckd_mul(&r.n, x.n, -1))
# 242| warning(WARN_RANGE, "integer multiplication saturated");
# 243| return r;
Error: COMPILER_WARNING:
groff-1.24.1/src/roff/troff/input.cpp:6674:18: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 9 equals destination size
# 6674 | strncpy(character, un, unibufsz);
# | ^
# 6672| const char *un = glyph_name_to_unicode(sc);
# 6673| if (un != 0 /* nullptr */)
# 6674|-> strncpy(character, un, unibufsz);
# 6675| else {
# 6676| warning(WARN_CHAR, "special character '%1' is not encodable"
Error: COMPILER_WARNING:
groff-1.24.1/src/roff/troff/input.cpp: scope_hint: In function ‘map_special_character_for_device_output(macro*, char const*) [clone .part.0]’
groff-1.24.1/src/roff/troff/input.cpp:6688:16: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 9 equals destination size
# 6688 | strncpy(character, un, unibufsz);
# | ^
# 6686| return;
# 6687| }
# 6688|-> strncpy(character, un, unibufsz);
# 6689| }
# 6690| mac->append_str("\\[u");
Error: CPPCHECK_WARNING (CWE-404):
groff-1.24.1/src/roff/troff/input.cpp:8297: error[resourceLeak]: Resource leak: fp
# 8295| error("cannot close file '%1' already associated with"
# 8296| " stream '%2': %3", filename, strerror(errno));
# 8297|-> return;
# 8298| }
# 8299| }
Error: CPPCHECK_WARNING (CWE-404):
groff-1.24.1/src/roff/troff/input.cpp:8303: error[resourceLeak]: Resource leak: fp
# 8301| new grostream(filename, mode, &*fp));
# 8302| }
# 8303|-> }
# 8304| tok.next();
# 8305| }
Error: COMPILER_WARNING:
groff-1.24.1/src/roff/troff/input.cpp: scope_hint: In function ‘main’
groff-1.24.1/src/roff/troff/input.cpp:8545:17: warning[-Wstringop-truncation]: ‘strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length
# 8545 | (void) strncpy(buf, char_prefix, char_prefix_len);
# | ^
# 8543| {
# 8544| char buf[16];
# 8545|-> (void) strncpy(buf, char_prefix, char_prefix_len);
# 8546| for (int i = 0; i < 256; i++) {
# 8547| (void) strcpy((buf + char_prefix_len), i_to_a(i));
Error: CPPCHECK_WARNING (CWE-415):
groff-1.24.1/src/roff/troff/input.cpp:9434: error[doubleFree]: Memory pointed to by 'pc' is freed twice.
# 9432| else
# 9433| pipe_command = pc;
# 9434|-> delete[] pc;
# 9435| tok.next();
# 9436| }
Error: COMPILER_WARNING:
groff-1.24.1/src/roff/troff/input.cpp: scope_hint: In member function ‘charinfo::dump()’
groff-1.24.1/src/roff/troff/input.cpp:11194:40: warning[-Wformat-truncation=]: ‘%.4X’ directive output may be truncated writing between 4 and 8 bytes into a region of size 6
#11194 | (void) snprintf(hexbuf, buflen, "%.4X", mapping);
# | ^~~~
groff-1.24.1/src/roff/troff/input.cpp:11194:39: note: directive argument in the range [0, 2147483647]
#11194 | (void) snprintf(hexbuf, buflen, "%.4X", mapping);
# | ^~~~~~
/usr/include/bits/stdio2.h:68:35: note: ‘__snprintf_chk’ output between 5 and 9 bytes into a destination of size 6
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
#11192| char hexbuf[buflen];
#11193| (void) memset(hexbuf, '\0', buflen);
#11194|-> (void) snprintf(hexbuf, buflen, "%.4X", mapping);
#11195| errprint(" Unicode mapping: U+%1\n", hexbuf);
#11196| }
Error: COMPILER_WARNING:
groff-1.24.1/src/roff/troff/node.cpp: scope_hint: In member function ‘glyph_node::asciify(macro*)’
groff-1.24.1/src/roff/troff/node.cpp:3949:46: warning[-Wformat-truncation=]: ‘%.4X’ directive output may be truncated writing between 4 and 8 bytes into a region of size 7
# 3949 | (void) snprintf(hexbuf, buflen, "%.4X", unicode_mapping);
# | ^~~~
groff-1.24.1/src/roff/troff/node.cpp:3949:45: note: directive argument in the range [0, 2147483647]
# 3949 | (void) snprintf(hexbuf, buflen, "%.4X", unicode_mapping);
# | ^~~~~~
/usr/include/bits/stdio2.h:68:35: note: ‘__snprintf_chk’ output between 5 and 9 bytes into a destination of size 7
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 3947| char hexbuf[buflen];
# 3948| (void) memset(hexbuf, '\0', buflen);
# 3949|-> (void) snprintf(hexbuf, buflen, "%.4X", unicode_mapping);
# 3950| m->append_str(hexbuf);
# 3951| m->append(']');
Error: COMPILER_WARNING:
groff-1.24.1/src/roff/troff/env.cpp:41: included_from: Included from here.
groff-1.24.1/src/roff/troff/reg.h:23:16: warning[-Woverloaded-virtual=]: ‘virtual bool reg::get_value(units*)’ was hidden
# 23 | virtual bool get_value(units *);
# | ^~~~~~~~~
groff-1.24.1/src/roff/troff/env.cpp:3296:8: note: by ‘bool unsigned_env_reg::get_value(unsigned int*)’
# 3296 | bool get_value(unsigned int *val);
# | ^~~~~~~~~
# 21| public:
# 22| virtual const char *get_string() = 0;
# 23|-> virtual bool get_value(units *);
# 24| virtual void increment();
# 25| virtual void decrement();