forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2df854f
committed
Fix misuse of memcpy() in check_ip().
The previous coding copied garbage into a local variable, pretty muchensuring that the intended test of an IPv6 connection address against apromoted IPv4 address from pg_hba.conf would never match. The lack offield complaints likely indicates that nobody realized this was supposedto work, which is unsurprising considering that no user-facing docs suggestit should work.In principle this could have led to a SIGSEGV due to reading off the end ofmemory, but since the source address would have pointed to somewhere in thefunction's stack frame, that's quite unlikely. What led to discovery ofthe bug is Hugo Osvaldo Barrera's report of a crash after an OS upgrade,which is probably because he is now running a system in which memcpy raisesabort() upon detecting overlapping source and destination areas. (You'dhave to additionally suppose some things about the stack frame layout toarrive at this conclusion, but it seems plausible.)This has been broken since the code was added, in commitf3aec2c,so back-patch to all supported branches.1 parent94e7b84 commit2df854f
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
706 | 706 |
| |
707 | 707 |
| |
708 | 708 |
| |
709 |
| - | |
710 |
| - | |
| 709 | + | |
| 710 | + | |
711 | 711 |
| |
712 | 712 |
| |
713 | 713 |
| |
|
0 commit comments
Comments
(0)