]> granicus.if.org Git - php/commit
Fix #79413: session_create_id() fails for active sessions
authorChristoph M. Becker <cmbecker69@gmx.de>
Thu, 26 Mar 2020 18:01:33 +0000 (19:01 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 31 Mar 2020 06:38:23 +0000 (08:38 +0200)
commitb510250b8ebe9d90b1db150d7a1edc75893f2e48
tree3adfd3eab317f4490d455d786a31dbfb855b5bfd
parenta681b12820ee1556668087bc7866006ca5329635
Fix #79413: session_create_id() fails for active sessions

The comment on `PS_VALIDATE_SID_FUNC(files)` is very clear that the
function is supposed to return `SUCCESS` if the session already exists.
So to detect a collision, we have to check for `SUCCESS`, not
`FAILURE`.

We also fix the wrong condition in session_regenerate_id() as well.
NEWS
ext/session/session.c
ext/session/tests/bug79091.phpt
ext/session/tests/bug79413.phpt [new file with mode: 0644]