Skip to content

Commit

Permalink
Merge pull request #74 from LeSuisse/value-by-ref-php-libsodium-1.x
Browse files Browse the repository at this point in the history
Ensure sodium_memzero() wipe the string when libsodium-php 1.x is used
  • Loading branch information
paragonie-scott committed Aug 29, 2018
2 parents bdf8b34 + cb9a155 commit 527e0a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -2592,8 +2592,11 @@ public static function memzero(&$var)
return;
}
if (self::use_fallback('memzero')) {
@call_user_func('\\Sodium\\memzero', $var);
return;
$func = '\\Sodium\\memzero';
$func($var);
if ($var === null) {
return;
}
}
// This is the best we can do.
throw new SodiumException(
Expand Down

0 comments on commit 527e0a9

Please sign in to comment.