Skip to content

Commit

Permalink
dkimf_db_walk: explicitly treat DKIMF_DB_MEMCACHE as unsupported db t…
Browse files Browse the repository at this point in the history
…ype.

This saves incorrect usage of DKIMF_DB_MEMCACHE from assertion failure
addressing to unknown DB type error, although it still need that
caller should handle the error properly.
  • Loading branch information
futatuki committed Jun 19, 2024
1 parent 551ab38 commit 80228d5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions opendkim/opendkim-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -5832,13 +5832,16 @@ dkimf_db_walk(DKIMF_DB db, _Bool first, void *key, size_t *keylen,
(key == NULL && keylen != NULL))
return -1;

if (db->db_type == DKIMF_DB_TYPE_REFILE ||
db->db_type == DKIMF_DB_TYPE_SOCKET ||
db->db_type == DKIMF_DB_TYPE_LUA)
return -1;

switch (db->db_type)
{
case DKIMF_DB_TYPE_REFILE:
case DKIMF_DB_TYPE_SOCKET:
case DKIMF_DB_TYPE_LUA:
case DKIMF_DB_MEMCACHE:
{
/* This operation does not support these type of dbs. */
return -1;
}
case DKIMF_DB_TYPE_CSL:
case DKIMF_DB_TYPE_FILE:
{
Expand Down

0 comments on commit 80228d5

Please sign in to comment.