]> git.ardis.lu - envpass/commitdiff
Clear `prf` on invalid chunk
authorArdis Lu <ardisglu@gmail.com>
Thu, 18 Jun 2026 06:15:43 +0000 (23:15 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 18 Jun 2026 06:15:43 +0000 (23:15 -0700)
Seems safer to just wipe it in case there is a scenario where a partial `prf` is sent.

src/getPrf.js

index 767629d81f298ec68ec0eb52001b2bb2315ea2eb..caa5257b2164ab785e00abb3145298d16b32c6ae 100644 (file)
@@ -143,6 +143,7 @@ export async function getPrf(options = {}) {
       request.on('data', chunk => {
         try { prf.set(chunk, offset); }
         catch { // Invalid chunk or too many bytes, stop processing immediately.
+          prf.fill(0);
           response.writeHead(400).end();
           request.destroy();
           return;
This page took 0.037414 seconds and 4 git commands to generate.