fix(proton): harden generated protobuf decoders

Reject malformed varints, out-of-bounds fields, and invalid groups before they escape their parent frame. Aggregate unknown-field metadata and decode signed int32 values while preserving SnowLuma's existing outbound encoding bytes.
This commit is contained in:
DrSmoothl committed 2026-07-10 13:40:53 +08:00
1 parent bb56030979
commit b7d648ea0f
7 files changed
+311 -32

No files matched your search

@@ -32,7 +32,7 @@ describe('SetSpecialTitle namespace', () => {
expect(env.body?.body?.specialTitle).toBe('crown');
// uinName (tag 7) must mirror specialTitle or the server silently no-ops.
expect(env.body?.body?.uinName).toBe('crown');
// -1 (int_32) round-trips as 0xFFFFFFFF after the proton decoder reinterprets.
expect(env.body?.body?.expireTime).toBe(0xFFFFFFFF);
// int_32 preserves the signed -1 sentinel after the wire round-trip.
expect(env.body?.body?.expireTime).toBe(-1);
});
});