From 38286df5370dce0351a9afac6e2fac39b47ab1a3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 23 Nov 2016 00:05:51 -0800 Subject: pr: fix integer overflow in buffer size calcs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Marcel Böhme (Bug#24996). * configure.ac (WERROR_CFLAGS): Avoid -Wtype-limits. * src/pr.c (col_sep_string): Now a const pointer. All uses changed. (integer_overflow): New function. (separator_string, main, init_parameters, init_store_cols): Check for integer overflow. (align_column, read_line, print_stored): Avoid integer overflow. --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index a48460114..1e74b361f 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,7 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Wswitch-enum" # Too many warnings for now nw="$nw -Wswitch-default" # Too many warnings for now nw="$nw -Wstack-protector" # not worth working around + nw="$nw -Wtype-limits" # False alarms for portable code # things I might fix soon: nw="$nw -Wfloat-equal" # sort.c, seq.c nw="$nw -Wmissing-format-attribute" # copy.c @@ -150,6 +151,7 @@ if test "$gl_gcc_warnings" = yes; then gl_WARN_ADD([$w]) done gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now + gl_WARN_ADD([-Wno-type-limits]) # False alarms for portable code gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now gl_WARN_ADD([-Wno-format-nonliteral]) -- cgit v1.2.3-70-g09d2