mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
Fixed MOPB-22-2007:PHP session_regenerate_id() Double Free Vulnerability
# Discovered by Stefan Esser
This commit is contained in:
parent
f9d54cbb75
commit
7aab16c333
@ -846,6 +846,7 @@ new_session:
|
||||
} else if (PS(invalid_session_id)) { /* address instances where the session read fails due to an invalid id */
|
||||
PS(invalid_session_id) = 0;
|
||||
efree(PS(id));
|
||||
PS(id) = NULL;
|
||||
goto new_session;
|
||||
}
|
||||
}
|
||||
@ -1575,6 +1576,7 @@ PHP_FUNCTION(session_regenerate_id)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
efree(PS(id));
|
||||
PS(id) = NULL;
|
||||
}
|
||||
|
||||
PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
|
||||
|
Loading…
Reference in New Issue
Block a user