Skip to content

Commit 9edba5d

Browse files
minor symfony#46624 [Security] Workaround segfault (chalasr)
This PR was merged into the 6.2 branch. Discussion ---------- [Security] Workaround segfault | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - For some reason, this patch avoids the segfault we have on the 6.2 security-http test suite (PHP 8.1). I didn't debug it further. Should be reported to php anyway I suppose. Commits ------- 498000e [Security] Workaround segfault
2 parents e74bd5b + 498000e commit 9edba5d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2222
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
2323
use Symfony\Component\Security\Core\Exception\AuthenticationException;
24-
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
2524
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
2625
use Symfony\Component\Security\Core\User\UserProviderInterface;
2726
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
@@ -85,8 +84,10 @@ public function authenticate(Request $request): Passport
8584
throw $e;
8685
}
8786

87+
$userBadge = new UserBadge($credentials['username'], $this->userProvider->loadUserByIdentifier(...));
88+
8889
$passport = new Passport(
89-
new UserBadge($credentials['username'], $this->userProvider->loadUserByIdentifier(...)),
90+
$userBadge,
9091
new PasswordCredentials($credentials['password'])
9192
);
9293
if ($this->userProvider instanceof PasswordUpgraderInterface) {

0 commit comments

Comments
 (0)