[Dovecot] two little fixes for 2.0.14
Timo Sirainen
tss at iki.fi
Tue Sep 13 02:10:29 EEST 2011
On 13.9.2011, at 2.00, Mike Abbott wrote:
> --- a/dovecot/src/lib-index/mail-index-view.c
> +++ b/dovecot/src/lib-index/mail-index-view.c
> @@ -9,7 +9,7 @@
> void mail_index_view_clone(struct mail_index_view *dest,
> const struct mail_index_view *src)
> {
> - memset(dest, 0, sizeof(dest));
> + memset(dest, 0, sizeof(*dest));
> dest->refcount = 1;
> dest->v = src->v;
> dest->index = src->index;
Luckily the only caller had it already cleared. Fixed anyway.
> --- a/dovecot/src/lib-storage/mail-storage-service.c
> +++ b/dovecot/src/lib-storage/mail-storage-service.c
> @@ -870,7 +870,7 @@
> }
>
> user = p_new(user_pool, struct mail_storage_service_user, 1);
> - memset(user_r, 0, sizeof(user_r));
> + memset(user_r, 0, sizeof(*user_r));
> user->pool = user_pool;
> user->input = *input;
> user->input.userdb_fields = NULL;
Here the sizeof() is the same in both cases, but the entire memset() is rather pointless, so removed it.
Did you find these with some tool, or grepping manually? :)
More information about the dovecot
mailing list