Skip to content

Commit 4eb5818

Browse files
committed
fix: prevent signer overwrite when adding multiple signers to envelope
Use count of existing signers as next index instead of complex calculation that could result in same index being reused, causing signers to overwrite each other when loading LibreSign signers without certificate data. Signed-off-by: Vitor Mattos <[email protected]>
1 parent fb4e45d commit 4eb5818

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/Service/File/SignersLoader.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ public function loadLibreSignSigners(
6464
if (!empty($found)) {
6565
$index = key($found);
6666
} else {
67-
$totalSigners = count($signers);
68-
$totalCert = count($certData);
69-
$index = $totalSigners > $totalCert ? $totalCert : $totalSigners - 1;
67+
// Find next available index
68+
$index = count($fileData->signers);
7069
}
7170
} else {
7271
$index = 0;

0 commit comments

Comments
 (0)