Commit 7fb8801
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 67fc4c9 commit 7fb8801
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
1037 | 1038 | | |
1038 | 1039 | | |
1039 | 1040 | | |
| 1041 | + | |
1040 | 1042 | | |
1041 | 1043 | | |
1042 | 1044 | | |
| |||
1164 | 1166 | | |
1165 | 1167 | | |
1166 | 1168 | | |
| 1169 | + | |
1167 | 1170 | | |
1168 | 1171 | | |
1169 | 1172 | | |
| |||
1740 | 1743 | | |
1741 | 1744 | | |
1742 | 1745 | | |
| 1746 | + | |
1743 | 1747 | | |
1744 | 1748 | | |
1745 | 1749 | | |
| |||
0 commit comments