From: Nick Porter Date: Mon, 21 Oct 2024 11:12:21 +0000 (+0100) Subject: Handle NULL returns from SQL when parsing map values X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38c5ec60320ddb2b591371846429f4d7371d6906;p=thirdparty%2Ffreeradius-server.git Handle NULL returns from SQL when parsing map values --- diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 1cbdda87b5d..af059d05695 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -772,6 +772,10 @@ static unlang_action_t mod_map_resume(rlm_rcode_t *p_result, UNUSED int *priorit map && (j < MAX_SQL_FIELD_INDEX); map = map_list_next(maps, map), j++) { if (field_index[j] < 0) continue; /* We didn't find the map RHS in the field set */ + if (!row[field_index[j]]) { + RWARN("Database returned NULL for %s", fields[j]); + continue; + } if (map_to_request(request, map, _sql_map_proc_get_value, row[field_index[j]]) < 0) goto error; } }