public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: Clear errno before calling strtol() in spell.c.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Clear errno before calling strtol() in spell.c.
@ 2025-03-08 16:25 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-08 16:25 UTC (permalink / raw)
  To: [email protected]

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 <[email protected]>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7fb880102138e45f58bf626cb2a4599bade8b172

Modified Files
--------------
src/backend/tsearch/spell.c | 4 ++++
1 file changed, 4 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Clear errno before calling strtol() in spell.c.
@ 2025-03-08 16:25 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-08 16:25 UTC (permalink / raw)
  To: [email protected]

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 <[email protected]>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/da85544ae53f8eb86dcf0e50e3df2aa9068ca38a

Modified Files
--------------
src/backend/tsearch/spell.c | 4 ++++
1 file changed, 4 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Clear errno before calling strtol() in spell.c.
@ 2025-03-08 16:25 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-08 16:25 UTC (permalink / raw)
  To: [email protected]

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 <[email protected]>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/99c01aadf979eed412a5189c8370ec8fe4784e6f

Modified Files
--------------
src/backend/tsearch/spell.c | 4 ++++
1 file changed, 4 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Clear errno before calling strtol() in spell.c.
@ 2025-03-08 16:25 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-08 16:25 UTC (permalink / raw)
  To: [email protected]

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 <[email protected]>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/61513da08b169fcc58c78bdf8752a81ea1fc92bd

Modified Files
--------------
src/backend/tsearch/spell.c | 4 ++++
1 file changed, 4 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Clear errno before calling strtol() in spell.c.
@ 2025-03-08 16:25 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-08 16:25 UTC (permalink / raw)
  To: [email protected]

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 <[email protected]>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e2921c0e9de3c153b9d75d1fcf219afce42f64c7

Modified Files
--------------
src/backend/tsearch/spell.c | 4 ++++
1 file changed, 4 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Clear errno before calling strtol() in spell.c.
@ 2025-03-08 16:25 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2025-03-08 16:25 UTC (permalink / raw)
  To: [email protected]

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 <[email protected]>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f1c1bafcdf76dbcdfcba506813bea5d939341631

Modified Files
--------------
src/backend/tsearch/spell.c | 4 ++++
1 file changed, 4 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2025-03-08 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-08 16:25 pgsql: Clear errno before calling strtol() in spell.c. Tom Lane <[email protected]>
2025-03-08 16:25 pgsql: Clear errno before calling strtol() in spell.c. Tom Lane <[email protected]>
2025-03-08 16:25 pgsql: Clear errno before calling strtol() in spell.c. Tom Lane <[email protected]>
2025-03-08 16:25 pgsql: Clear errno before calling strtol() in spell.c. Tom Lane <[email protected]>
2025-03-08 16:25 pgsql: Clear errno before calling strtol() in spell.c. Tom Lane <[email protected]>
2025-03-08 16:25 pgsql: Clear errno before calling strtol() in spell.c. Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox