util/qemu-option: Document the get_opt_value() function
commit8f4d9555823636c329cb40afc6f36969ec5d35e4
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 29 Jun 2020 07:08:58 +0000 (29 09:08 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 7 Jul 2020 10:38:50 +0000 (7 12:38 +0200)
tree7611f209465a4799e467d7a293ce5e972f7ed3a9
parent428a37770406346dac6d355a70ea5a8916aecb1f
util/qemu-option: Document the get_opt_value() function

Coverity noticed commit 950c4e6c94 introduced a dereference before
null check in get_opt_value (CID1391003):

  In get_opt_value: All paths that lead to this null pointer
  comparison already dereference the pointer earlier (CWE-476)

We fixed this in commit 6e3ad3f0e31, but relaxed the check in commit
0c2f6e7ee99 because "No callers of get_opt_value() pass in a NULL
for the 'value' parameter".

Since this function is publicly exposed, it risks new users to do
the same error again. Avoid that documenting the 'value' argument
must not be NULL.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200629070858.19850-1-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
include/qemu/option.h