kopia lustrzana https://github.com/mikaelnousiainen/RS41ng
Fix APRS call sign padding and reading past end of source buffer
rodzic
591c5cb2d3
commit
8c13702598
|
@ -81,12 +81,14 @@ uint16_t ax25_encode_packet_aprs(char *source, uint8_t source_ssid, char *destin
|
|||
|
||||
header->flag = AX25_PACKET_FLAG;
|
||||
|
||||
size_t call_length = strlen(source);
|
||||
memset(header->source, ' ', sizeof(header->source));
|
||||
memcpy(header->source, source, 6);
|
||||
memcpy(header->source, source, call_length < 6 ? call_length : 6);
|
||||
header->source_ssid = (uint8_t) (source_ssid >= 'A' ? source_ssid - 7 : source_ssid);;
|
||||
|
||||
call_length = strlen(destination);
|
||||
memset(header->destination, ' ', sizeof(header->destination));
|
||||
memcpy(header->destination, destination, 6);
|
||||
memcpy(header->destination, destination, call_length < 6 ? call_length : 6);
|
||||
header->destination_ssid = destination_ssid;
|
||||
|
||||
char *digipeater_addresses_start = ((char *) header) + 1 + 14;
|
||||
|
|
Ładowanie…
Reference in New Issue