prevent can from parsing partial frames
This commit is contained in:
1 parent
4dbf6d4d3d
commit
d44ecffb41
1 file changed
+2
@@ -120,6 +120,8 @@ void read_can(Tel *t, int soc) {
|
|||||||
|
|
||||||
if (nbytes < 0) return; // -1 EAGAIN means empty
|
if (nbytes < 0) return; // -1 EAGAIN means empty
|
||||||
|
|
||||||
|
if (nbytes != sizeof(struct can_frame)) return;
|
||||||
|
|
||||||
if (nbytes > 0) {
|
if (nbytes > 0) {
|
||||||
|
|
||||||
switch (frame.can_id) {
|
switch (frame.can_id) {
|
||||||
|
|||||||
Reference in new issue
Block a user