fix(MESHAGEN-005): CU-86akhf8u3 2 review findings across 2 files - #126
flamingo[bot] wants to merge 2 commits into
Conversation
|
|
||
| this.write(js, function () { | ||
| // Write the size of the javascript without padding | ||
| var sz = new Buffer(4); |
There was a problem hiding this comment.
🦩 🔴 new Buffer(4) used instead of Buffer.alloc/Buffer.from in exe.js
Replaced new Buffer(4) with Buffer.alloc(4) in the OnWroteExe function (the write-stream callback that writes the JS length before the trailing GUID), matching the Buffer.alloc/Buffer.from style already used elsewhere in the file. This removes the deprecated/unsafe Buffer constructor and zero-fills the allocated memory.
🤖 Prompt for AI agents
In modules/exe.js around line 160, review and complete this code-review fix: new Buffer(4) used instead of Buffer.alloc/Buffer.from in exe.js.
What the draft fix changed: Replaced `new Buffer(4)` with `Buffer.alloc(4)` in the `OnWroteExe` function (the write-stream callback that writes the JS length before the trailing GUID), matching the `Buffer.alloc`/`Buffer.from` style already used elsewhere in the file. This removes the deprecated/unsafe Buffer constructor and zero-fills the allocated memory.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟢 98 high — react 👍/👎 to teach the reviewer
| @@ -179,7 +179,7 @@ OPENSSL_store_u64_le(unsigned char *out, uint64_t val) | |||
| static ossl_inline ossl_unused unsigned char * | |||
There was a problem hiding this comment.
🦩 🔴 Copy-paste bug: OSSL_HTOLE64 guard used for be64 load/store instead of OSSL_HTOBE64/OSSL_LE64TOH
Changed the preprocessor guards in OPENSSL_store_u64_be (#ifdef OSSL_HTOLE64 -> #ifdef OSSL_HTOBE64), OPENSSL_load_u16_be (#ifdef OSSL_LE16TOH -> #ifdef OSSL_BE16TOH), OPENSSL_load_u32_be (#ifdef OSSL_LE32TOH -> #ifdef OSSL_BE32TOH), and OPENSSL_load_u64_be (#ifdef OSSL_LE64TOH -> #ifdef OSSL_BE64TOH) in openssl/include/openssl/byteorder.h, so each big-endian store/load function's fast path is now guarded by the matching BE macro instead of the coincidentally-paired LE macro, matching the fix suggested for the explicitly reported OPENSSL_store_u64_be case and applying the same correction consistently to the analogous be-load functions that had the identical latent bug.
🤖 Prompt for AI agents
In openssl/include/openssl/byteorder.h around line 179, review and complete this code-review fix: Copy-paste bug: OSSL_HTOLE64 guard used for be64 load/store instead of OSSL_HTOBE64/OSSL_LE64TOH.
What the draft fix changed: Changed the preprocessor guards in OPENSSL_store_u64_be (`#ifdef OSSL_HTOLE64` -> `#ifdef OSSL_HTOBE64`), OPENSSL_load_u16_be (`#ifdef OSSL_LE16TOH` -> `#ifdef OSSL_BE16TOH`), OPENSSL_load_u32_be (`#ifdef OSSL_LE32TOH` -> `#ifdef OSSL_BE32TOH`), and OPENSSL_load_u64_be (`#ifdef OSSL_LE64TOH` -> `#ifdef OSSL_BE64TOH`) in `openssl/include/openssl/byteorder.h`, so each big-endian store/load function's fast path is now guarded by the matching BE macro instead of the coincidentally-paired LE macro, matching the fix suggested for the explicitly reported OPENSSL_store_u64_be case and applying the same correction consistently to the analogous be-load functions that had the identical latent bug.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer
Closes 2 review findings across 2 files.
Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
modules/exe.js:160openssl/include/openssl/byteorder.h:179What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
bc788a01-3d0c-4679-816f-282037bb5004Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.
ClickUp task: CU-86akhf8u3 MeshAgent review findings sweep (13 PRs)