Yeah, it makes no sense. Probably you are right about the forgot removal.


2013/11/25 Edward Welbourne <notifications@github.com>

> In cf-agent/verify_files_hashes.c:
>
> > @@ -334,8 +334,10 @@ void PurgeHashes(EvalContext *ctx, char *path, Attributes attr, Promise *pp)
> >              LogHashChange(obj, FILE_STATE_REMOVED, "File removed", pp);
> >          }
> >
> > -        memset(&key, 0, sizeof(key));
>
> This looks suspiciously like you're fixing the wrong mistake; we need to
> find out what the original author intended, e.g. did they intend to clear
> the key from memory, as memset(key, 0, ksize); and similarly for value ?
> Setting the pointers and sizes to NULL and 0 serves no purpose, at least:
> I'm fairly sure NextDB() over-writes whatever values they get. My trawl
> through the history of these lines suggests that someone merely forgot to
> remove them when the types used for key and value got changed ! So I think
> simply removing the lines would be better.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/cfengine/core/pull/1112/files#r7894675>
> .
>