If usrc is a prefix of cp but one character shorter an out of bounds
access to usrc was done.
+2018-07-25 Andreas Schwab <schwab@suse.de>
+
+ [BZ #23442]
+ * locale/weightwc.h (findidx): Handle the case where usrc is a
+ prefix of cp but one character too short.
+
2018-07-24 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* NEWS: Add ISO C threads addition.
break;
DIAG_POP_NEEDS_COMMENT;
- if (cnt < nhere - 1)
+ if (cnt < nhere - 1 || cnt == len)
{
cp += 2 * nhere;
continue;
same reason as described above. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
- if (cp[nhere - 1] > usrc[nhere -1])
+ if (cp[nhere - 1] > usrc[nhere - 1])
{
cp += 2 * nhere;
continue;
}
DIAG_POP_NEEDS_COMMENT;
- if (cp[2 * nhere - 1] < usrc[nhere -1])
+ if (cp[2 * nhere - 1] < usrc[nhere - 1])
{
cp += 2 * nhere;
continue;