Mercurial > dovecot > core-2.2
changeset 19381:d39daee9d72c
lib-fs: Added asserts to fs_set_metadata() to make sure key and value are non-NULL
Otherwise the bug would be noticed only much later when trying to
dereference NULL pointer.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 17 Nov 2015 16:30:16 +0200 |
parents | 6bf404e276c6 |
children | b4a406dce5b8 |
files | src/lib-fs/fs-api.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-fs/fs-api.c Tue Nov 17 11:51:45 2015 +0200 +++ b/src/lib-fs/fs-api.c Tue Nov 17 16:30:16 2015 +0200 @@ -302,6 +302,9 @@ void fs_set_metadata(struct fs_file *file, const char *key, const char *value) { + i_assert(key != NULL); + i_assert(value != NULL); + if (file->fs->v.set_metadata != NULL) T_BEGIN { file->fs->v.set_metadata(file, key, value); file->metadata_changed = TRUE;