Skip to content

Commit

Permalink
modules: hostap: Resolve build warning with strncpy
Browse files Browse the repository at this point in the history
Make sure to copy LEN -1 bytes to the destination, to
accommodate the terminating null byte.

Signed-off-by: Ravi Dondaputi <[email protected]>
  • Loading branch information
rado17 authored and jfischer-no committed Mar 11, 2024
1 parent 5899077 commit f45bb4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/hostap/src/supp_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static int wpa_supp_process_status(struct supp_int_event_data *event_data, char
case WPA_SUPP_EVENT_NETWORK_ADDED:
case WPA_SUPP_EVENT_NETWORK_REMOVED:
strncpy(data->supp_event_str, event_info.event_str,
sizeof(data->supp_event_str));
sizeof(data->supp_event_str)-1);
event_data->data_len = strlen(data->supp_event_str) + 1;
case WPA_SUPP_EVENT_DSCP_POLICY:
/* TODO */
Expand Down

0 comments on commit f45bb4d

Please sign in to comment.