mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[ntcore] Check id ranges in control messages (#7726)
This commit is contained in:
@@ -423,4 +423,20 @@ TEST_F(ServerImplTest, ZeroTimestampNegativeTime) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ServerImplTest, InvalidPubUid) {
|
||||
EXPECT_CALL(logger, Call(_, _, _, "0: pubuid out of range"));
|
||||
server.SetLocal(&local, &queue);
|
||||
|
||||
// connect client
|
||||
::testing::StrictMock<net::MockWireConnection> wire;
|
||||
MockSetPeriodicFunc setPeriodic;
|
||||
auto [name, id] = server.AddClient("test", "connInfo", false, wire,
|
||||
setPeriodic.AsStdFunction());
|
||||
|
||||
server.ProcessIncomingText(
|
||||
id,
|
||||
"[{\"method\":\"publish\",\"params\":{\"type\":\"string\",\"name\":"
|
||||
"\"myvalue\",\"pubuid\":2147483647,\"properties\":{}}}]");
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
|
||||
Reference in New Issue
Block a user