]> git.ipfire.org Git - thirdparty/coreutils.git/commit
pr: don’t use uninitialized var
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Apr 2022 23:13:55 +0000 (16:13 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Apr 2022 23:14:50 +0000 (16:14 -0700)
commit81d58df1647ea79c5161f99d8bd241f0c78df729
tree43115dce20f5f3d195da834079c90b27b3a443f7
parent913f14bbd0152246a22f60a07025bdcc9d574903
pr: don’t use uninitialized var

Found with -flto and --enable-gcc-warnings.
* src/pr.c (getoptarg): Fix misuse of xstrtol, which does not
necessarily set tmp_long on errror, and does not set errno in any
reliable way.  The previous code might access uninitialized
storage; on typical platforms this merely causes it to possibly
print the wrong diagnostic.
src/pr.c