Re: Dead code in hol_entry_help

2016-01-10 Thread Andrei Borzenkov
On Mon, Jan 11, 2016 at 9:56 AM, Paul Eggert wrote: > Andrei Borzenkov wrote: >> >> It looks like assignment to first_long_opt is >> missing somewhere. > > > It seems to have been missing ever since it was added. > > I assume that both bugs you mentioned don't occur in glibc. Perhaps all we > need

Re: Dead code in hol_entry_help

2016-01-10 Thread Paul Eggert
Andrei Borzenkov wrote: It looks like assignment to first_long_opt is missing somewhere. It seems to have been missing ever since it was added. I assume that both bugs you mentioned don't occur in glibc. Perhaps all we need to do is to merge glibc's argp changes into gnulib. Attached is a fir

Re: [PATCH] crypto modules: the integer literals in BLOCKSIZE may be too large

2016-01-10 Thread Paul Eggert
Hong Xu wrote: The BLOCKSIZE is defined as 32768, which may be too large if the default signed integer size is no larger than 16 bits. GNU code as a rule does not worry about machines where 'int' is less than 32 bits. POSIX requires 'int' to be at least 32 bits nowadays.

[PATCH] crypto modules: the integer literals in BLOCKSIZE may be too large

2016-01-10 Thread Hong Xu
The BLOCKSIZE is defined as 32768, which may be too large if the default signed integer size is no larger than 16 bits. --- lib/md2.c| 5 +++-- lib/md4.c| 5 +++-- lib/md5.c| 5 +++-- lib/sha1.c | 5 +++-- lib/sha256.c | 5 +++-- lib/sha512.c | 5 +++-- 6 files changed, 18 insertions

Possible NULL pointer dereference in hol_entry_help

2016-01-10 Thread Andrei Borzenkov
Found by Coverity scan for GRUB. hol_entry_help dereferences state parameter without checking for NULL: if (first_long_opt || uparams.dup_args) arg (real, "=%s", "[=%s]", state->root_argp->argp_domain, stream); It is called in several places where "st

Dead code in hol_entry_help

2016-01-10 Thread Andrei Borzenkov
This was found by Coverity scan of GRUB hol_entry_help contains the following code /* A real long option. */ { int first_long_opt = 1; __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col); for (opt = real, num = entry->num; num > 0; opt++, num--) if (opt