Commit 99c01aa
committed
Clear errno before calling strtol() in spell.c.
Per POSIX, a caller of strtol() that wishes to check for errors must
set errno to 0 beforehand. Several places in spell.c neglected that,
so that they risked delivering a false overflow error in case errno
had been ERANGE already. Given the lack of field reports, this case
may be unreachable at present --- but it's surely trouble waiting to
happen, so fix it.
Author: Jacob Brazeal <jacob.brazeal@gmail.com>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 131 parent c3510cf commit 99c01aa
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
| |||
1036 | 1037 | | |
1037 | 1038 | | |
1038 | 1039 | | |
| 1040 | + | |
1039 | 1041 | | |
1040 | 1042 | | |
1041 | 1043 | | |
| |||
1163 | 1165 | | |
1164 | 1166 | | |
1165 | 1167 | | |
| 1168 | + | |
1166 | 1169 | | |
1167 | 1170 | | |
1168 | 1171 | | |
| |||
1735 | 1738 | | |
1736 | 1739 | | |
1737 | 1740 | | |
| 1741 | + | |
1738 | 1742 | | |
1739 | 1743 | | |
1740 | 1744 | | |
| |||
0 commit comments