]> Savannah Git Hosting - gnulib.git/commit
quotearg: avoid undefined and/or O(N**2)
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 4 Apr 2021 02:59:10 +0000 (19:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 4 Apr 2021 03:15:43 +0000 (20:15 -0700)
commit7969591f9bdb853027199a50b6b760bc5c9cce29
tree58b6c339b08becc60d27383d97f124c77a92172e
parentf30ed230ed479fb1de1cfabadad7b3905ec8b641
quotearg: avoid undefined and/or O(N**2)

Avoid undefined and O(N**2) behavior in some very unlikely cases.
* lib/quotearg.c (quotearg_n_options): Document that N must
be less than MIN (INT_MAX, IDX_MAX), and add this to the
abort test; this also avoids a conditional branch.
Use xpalloc instead of xrealloc, to avoid O(N**2) behavior in
very-unlikely cases.
ChangeLog
lib/quotearg.c