]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Handle NULL returns from SQL when parsing map values
authorNick Porter <nick@portercomputing.co.uk>
Mon, 21 Oct 2024 11:12:21 +0000 (12:12 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 21 Oct 2024 15:37:56 +0000 (16:37 +0100)
src/modules/rlm_sql/rlm_sql.c

index 1cbdda87b5d43b91c1e87744b36704b2a4b2de56..af059d0569513df80dfe3481ef415fd2f45528fa 100644 (file)
@@ -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;
                }
        }