]> git.proxmox.com Git - libgit2.git/commit
coverity: hint git_vector_foreach does not deref NULL contents
authorPatrick Steinhardt <ps@pks.im>
Mon, 22 Feb 2016 13:43:28 +0000 (14:43 +0100)
committerPatrick Steinhardt <ps@pks.im>
Tue, 23 Feb 2016 10:50:23 +0000 (11:50 +0100)
commitf2a554b45e52d7e682f26796e492cd64d8b9a6f4
tree87a209d14f51595cd891d293d86e386fc9d6bf05
parentfb96b28cd9f66998f38a56abb7398ea899c12512
coverity: hint git_vector_foreach does not deref NULL contents

Coverity does not comprehend the connection between a vector's
size and the contents pointer, that is that the vector's pointer
is non-NULL when its size is positive. As the vector code should
be reasonably well tested and users are expected to not manually
modify a vector's contents it seems save to assume that the
macros will never dereference a NULL pointer.

Fix Coverity warnings by overriding the foreach macros with
macros that explicitly aborting when (v)->contents is NULL.
script/user_nodefs.h