-
Notifications
You must be signed in to change notification settings - Fork 1
fix(MESHCENT-004): CU-86akbhg5u 8 review findings across 6 files #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
783678d
f6f9199
08d2aef
086baf8
db13959
723daa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and | |
| limitations under the License. | ||
| */ | ||
|
|
||
| /*xjslint node: true */ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π exeHandler.js jshint block includes non-standard /xjslint/ directives alongside jshint Removed the three dead π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| /*xjslint plusplus: true */ | ||
| /*xjslint maxlen: 256 */ | ||
| /*jshint node: true */ | ||
| /*jshint strict: false */ | ||
| /*jshint esversion: 6 */ | ||
|
|
@@ -225,7 +222,12 @@ module.exports.parseWindowsExecutable = function (exePath) { | |
| // Read the authenticode certificate, only one cert (only the first entry) | ||
| var hdr = Buffer.alloc(8); | ||
| fs.readSync(fd, hdr, 0, hdr.length, retVal.CertificateTableAddress); | ||
| retVal.certificate = Buffer.alloc(hdr.readUInt32LE(0)); | ||
| var certLength = hdr.readUInt32LE(0); | ||
| if (certLength > (128 * 1024 * 1024)) { // Sanity bound to guard against malformed/malicious length fields | ||
| fs.closeSync(fd); | ||
| throw ('certificate table length exceeds maximum allowed size'); | ||
| } | ||
| retVal.certificate = Buffer.alloc(certLength); | ||
| fs.readSync(fd, retVal.certificate, 0, retVal.certificate.length, retVal.CertificateTableAddress + hdr.length); | ||
| retVal.certificate = retVal.certificate.toString('base64'); | ||
| retVal.certificateDwLength = hdr.readUInt32LE(0); | ||
|
Comment on lines
222
to
233
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ exeHandler.js parseWindowsExecutable trusts embedded certificate length fields without bounds checking In π€ Prompt for AI agentsfix confidence: π‘ 70 medium β react π/π to teach the reviewer |
||
|
|
@@ -308,3 +310,4 @@ module.exports.hashExecutableFile = function (options) { | |
| options.state.source.pipe(options.targetStream); | ||
| } | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| /* jshint node: true */ | ||
| /* jshint esversion: 6 */ | ||
| 'use strict'; | ||
|
|
||
| /** | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π mcrec.js missing jshint directives and 'use strict' Added π€ Prompt for AI agentsfix confidence: π‘ 85 medium β react π/π to teach the reviewer |
||
| * @description MeshCentral MeshAgent | ||
| * @author Ylian Saint-Hilaire | ||
|
|
@@ -227,7 +231,6 @@ function readLastBlock(state, func) { | |
| var magic = buf.toString('utf8', 16, 32); | ||
| if ((type == 3) && (size == 16) && (magic == 'MeshCentralMCNDX')) { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π readLastBlock in mcrec.js references undefined variable Removed the stray, unused π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| // Extra metadata present, lets read it. | ||
| extraMetadata = null; | ||
| var buf2 = Buffer.alloc(16); | ||
| fs.read(state.recFile, buf2, 0, 16, time, function (err, bytesRead, buf2) { | ||
| var xtype = buf2.readUInt16BE(0); // Type (1 = Header, 2 = Network Data, 3 = End, 4 = Extra Metadata) | ||
|
|
@@ -331,4 +334,4 @@ if (directRun) { setup(); } | |
|
|
||
| // Export table | ||
| module.exports.startEx = startEx; | ||
| module.exports.indexFile = indexFile; | ||
| module.exports.indexFile = indexFile; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,6 @@ | |
| * @version v0.0.1 | ||
| */ | ||
|
|
||
| /*xjslint node: true */ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π meshmail.js uses xjslint hints instead of standard jshint node/strict directives layout Removed the three legacy π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
| /*xjslint plusplus: true */ | ||
| /*xjslint maxlen: 256 */ | ||
| /*jshint node: true */ | ||
| /*jshint strict: false */ | ||
| /*jshint esversion: 6 */ | ||
|
|
@@ -777,4 +774,4 @@ module.exports.CreateMeshMail = function (parent, domain) { | |
| } | ||
|
|
||
| return obj; | ||
| }; | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π agents/hashagents.js lacks jshint/strict-mode header conventions
Added the standard jshint directive block (
/*jshint node: true */,/*jshint strict: false */,/*jshint esversion: 6 */) and a"use strict";declaration at the top of agents/hashagents.js, before the existingvar fs = require('fs');line, matching the convention used in meshcentral.js and amt/amt-wsman.js. No other code was changed.π€ Prompt for AI agents
fix confidence: π’ 90 high β react π/π to teach the reviewer