add clamp for path length

This commit is contained in:
PacoX
2026-05-27 08:32:16 +02:00
parent 5d03f99040
commit 6e81fdfd46
3 changed files with 125 additions and 4 deletions
+4 -3
View File
@@ -2798,9 +2798,10 @@ class MeshCoreConnector extends ChangeNotifier {
if (!isConnected) return;
final mode = _pathHashByteWidth - 1;
final encodedPathLen = (pathLen >= 0 && pathLen != 0xFF)
? (pathLen | (mode << 6))
: pathLen;
if (pathLen < 0 || pathLen > 0x3F) {
return;
}
final encodedPathLen = pathLen | (mode << 6);
await sendFrame(
buildUpdateContactPathFrame(
contact.publicKey,