weather-service: Fix buffer overflow in get_icon_name_sortkey()
We can just use strlen() here. Fixes #425
This commit is contained in:
@@ -309,7 +309,8 @@ get_icon_name_sortkey (const gchar *icon_name,
|
|||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (icons); i++)
|
for (i = 0; i < G_N_ELEMENTS (icons); i++)
|
||||||
{
|
{
|
||||||
if (icons[i].name[normalized_name_len] == '\0' && strncmp (icon_name, icons[i].name, normalized_name_len) == 0)
|
if (normalized_name_len == strlen (icons[i].name) &&
|
||||||
|
strncmp (icon_name, icons[i].name, normalized_name_len) == 0)
|
||||||
{
|
{
|
||||||
*supports_night_icon = icons[i].night_support;
|
*supports_night_icon = icons[i].night_support;
|
||||||
return i;
|
return i;
|
||||||
|
|||||||
Reference in New Issue
Block a user