add clamp for path length

This commit is contained in:
PacoX committed 2026-05-27 08:32:16 +02:00
1 parent 5d03f99040
commit 6e81fdfd46
3 files changed
+125 -4

No files matched your search

+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,