File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,18 +145,14 @@ uint8_t ESBNetwork<radio_t>::update(void)
145145 frame_size = MAX_FRAME_SIZE;
146146#endif
147147
148- if (frame_size < sizeof (RF24NetworkHeader)) {
149- continue ;
150- }
151-
152148 // Fetch the payload, and see if this was the last one.
153149 radio.read (frame_buffer, frame_size);
154150
155151 // Read the beginning of the frame as the header
156152 RF24NetworkHeader* header = (RF24NetworkHeader*)(&frame_buffer);
157153
158154 // Throw it away if it's not a valid address or too small
159- if (!is_valid_address (header->to_node ) || !is_valid_address (header->from_node )) {
155+ if (frame_size < sizeof (RF24NetworkHeader) || !is_valid_address (header->to_node ) || !is_valid_address (header->from_node )) {
160156 continue ;
161157 }
162158 // IF_RF24NETWORK_DEBUG(printf_P(PSTR("MAC Received " PRIPSTR
You can’t perform that action at this time.
0 commit comments