From eb5370f71ff9e6ec9e0e6cdc8e89f12c877716bd Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 1 Dec 2013 06:32:12 +0100 Subject: [PATCH] Be sure to terminate strings when parsing the current status --- src/applets/wpa_supplicant.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/applets/wpa_supplicant.c b/src/applets/wpa_supplicant.c index 53dbd5d..3895912 100644 --- a/src/applets/wpa_supplicant.c +++ b/src/applets/wpa_supplicant.c @@ -614,6 +614,8 @@ static gboolean _read_status(WPA * wpa, char const * buf, size_t cnt) #endif if(sscanf(p, "%79[^=]=%79[^\n]", variable, value) != 2) continue; + variable[sizeof(variable) - 1] = '\0'; + value[sizeof(value) - 1] = '\0'; if(strcmp(variable, "wpa_state") == 0) gtk_image_set_from_stock(GTK_IMAGE(wpa->image), (strcmp(value, "COMPLETED") == 0)