mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-19 20:27:26 -05:00
Fix Some UTF8 String Overflow Issues;
This commit is contained in:
@@ -461,7 +461,9 @@ void decode_ip_pdu (dsd_opts * opts, dsd_state * state, uint16_t len, uint8_t *
|
|||||||
{
|
{
|
||||||
sprintf (state->dmr_lrrp_gps[slot], " IP Call SRC: %d; Port; %d; DST: %d; Port: %d;", src24, port1, dst24, port2);
|
sprintf (state->dmr_lrrp_gps[slot], " IP Call SRC: %d; Port; %d; DST: %d; Port: %d;", src24, port1, dst24, port2);
|
||||||
fprintf (stderr, "Unknown UDP Port;");
|
fprintf (stderr, "Unknown UDP Port;");
|
||||||
utf8_to_text(state, 0, len-28, input+28);
|
if (len > 28)
|
||||||
|
utf8_to_text(state, 0, len-28, input+28);
|
||||||
|
else utf8_to_text(state, 0, len, input+28);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -470,7 +472,9 @@ void decode_ip_pdu (dsd_opts * opts, dsd_state * state, uint16_t len, uint8_t *
|
|||||||
{
|
{
|
||||||
sprintf (state->dmr_lrrp_gps[slot], " IP Call SRC: %d; DST: %d; Protocol: %d;", src24, dst24, prot);
|
sprintf (state->dmr_lrrp_gps[slot], " IP Call SRC: %d; DST: %d; Protocol: %d;", src24, dst24, prot);
|
||||||
fprintf(stderr, "Unknown IP Protocol: %02X;", prot);
|
fprintf(stderr, "Unknown IP Protocol: %02X;", prot);
|
||||||
utf8_to_text(state, 0, len-28, input+28);
|
if (len > 28)
|
||||||
|
utf8_to_text(state, 0, len-28, input+28);
|
||||||
|
else utf8_to_text(state, 0, len, input+28);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,7 +254,12 @@ void p25_decode_pdu_data(dsd_opts * opts, dsd_state * state, uint8_t * input, in
|
|||||||
else if (sap == 48) //Tier 1 Location Service (or does it depend on the io bit?)
|
else if (sap == 48) //Tier 1 Location Service (or does it depend on the io bit?)
|
||||||
utf8_to_text(state, 0, len-ptr, input+ptr); //TODO, read initial string, i.e., $GPRMC and properly decode
|
utf8_to_text(state, 0, len-ptr, input+ptr); //TODO, read initial string, i.e., $GPRMC and properly decode
|
||||||
|
|
||||||
else utf8_to_text(state, 0, len-ptr, input+ptr); //default catch all
|
else //default catch all
|
||||||
|
{
|
||||||
|
if (len > ptr)
|
||||||
|
utf8_to_text(state, 0, len-ptr, input+ptr);
|
||||||
|
else utf8_to_text(state, 0, len, input+ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user