Skip to content

Commit

Permalink
fix(vendor.viomi): Fix parser freezing when encountering unexpected s…
Browse files Browse the repository at this point in the history
…egment name data
  • Loading branch information
Hypfer committed Apr 2, 2023
1 parent 3eb9548 commit fc73347
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/lib/robots/3irobotix/ThreeIRobotixMapParser.js
Expand Up @@ -311,6 +311,11 @@ class ThreeIRobotixMapParser {
const segmentCount = block.view.readUInt32LE(offset);
offset += 4;

if (segmentCount > 0xff) {
// This seems to be a map file that contains more than one map name. Aborting for now
return segments;
}

for (let i = 0; i < segmentCount; i++) {
const segmentId = block.view[offset];
const nameLength = block.view[offset +1];
Expand Down

0 comments on commit fc73347

Please sign in to comment.