Skip to content

Commit

Permalink
wifi-nm: guard null derefs
Browse files Browse the repository at this point in the history
  • Loading branch information
LBCrion committed Jan 31, 2024
1 parent 916cf01 commit fe6e601
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/wifi-nm.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ static gboolean nm_apoint_xref ( nm_apoint_t *ap )
nm_active_t *active;
gboolean change = FALSE;

g_return_val_if_fail(ap, FALSE);
conn = nm_apoint_get_conn(ap);
if(ap->conn != conn)
{
Expand Down Expand Up @@ -618,7 +619,7 @@ static void nm_ap_node_handle ( const gchar *path, gchar *ifa, GVariant *dict )

if(g_variant_lookup(dict, "Strength", "y", &strength))
{
node->strength = CLAMP(strength, 0, 100);
node->strength = MIN(strength, 100);
ap_strength = 0;
for(iter=apoint->nodes; iter; iter=g_list_next(iter))
ap_strength = MAX(ap_strength, NM_AP_NODE(iter->data)->strength);
Expand Down

0 comments on commit fe6e601

Please sign in to comment.