cur = session->ctx->cfg->maps;
while (cur) {
map = cur->data;
- if (map->protocol == MAP_PROTO_FILE && map->description != NULL) {
+ if (map->protocol == MAP_PROTO_FILE) {
if (access (map->uri, R_OK) == 0) {
tmp = g_list_prepend (tmp, map);
}
obj = ucl_object_typed_new (UCL_OBJECT);
ucl_object_insert_key (obj, ucl_object_fromint (map->id),
"map", 0, false);
- ucl_object_insert_key (obj, ucl_object_fromstring (map->description),
- "description", 0, false);
+ if (map->description) {
+ ucl_object_insert_key (obj, ucl_object_fromstring (map->description),
+ "description", 0, false);
+ }
ucl_object_insert_key (obj, ucl_object_frombool (editable),
"editable", 0, false);
ucl_array_append (top, obj);
reply->body = g_string_sized_new (st.st_size);
/* Read the whole buffer */
- if (read (fd, msg->body->str, st.st_size) == -1) {
+ if (read (fd, reply->body->str, st.st_size) == -1) {
rspamd_http_message_free (reply);
msg_err ("cannot read map %s: %s", map->uri, strerror (errno));
rspamd_controller_send_error (conn_ent, 500, "500 map read error");