All of lore.kernel.org
 help / color / mirror / Atom feed
* [tpm2] [intel/tpm2-tools] dbaf76: lib: fix tpm2_print_usage() when tools have no opt...
@ 2018-01-10 20:33 GitHub
  0 siblings, 0 replies; only message in thread
From: GitHub @ 2018-01-10 20:33 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 1211 bytes --]

  Branch: refs/heads/master
  Home:   https://github.com/intel/tpm2-tools
  Commit: dbaf76f07e8921ce0fffdc35bc3108a64fb222e3
      https://github.com/intel/tpm2-tools/commit/dbaf76f07e8921ce0fffdc35bc3108a64fb222e3
  Author: Javier Martinez Canillas <javierm(a)redhat.com>
  Date:   2018-01-10 (Wed, 10 Jan 2018)

  Changed paths:
    M lib/tpm2_options.c

  Log Message:
  -----------
  lib: fix tpm2_print_usage() when tools have no options/args

For tools that takes no options and arguments, its struct tpm2_options is
NULL so trying to access it will lead to a NULL pointer dereference error.

This is checked in the main() function before calling tpm2_print_usage(),
but it was checked when tpm2_print_usage() was added as a fallback to the
--help option when executing the man pager fails.

Instead of relying of the caller to do the check, make tpm2_print_usage()
robust enough to cope with being called with a NULL struct tpm2_options.

After all, it makes no sense to print a usage text for a tool that takes
neither options nor arguments.

Fixes: #760

Reported-by: Emmanuel Deloget <logout(a)free.fr>
Signed-off-by: Javier Martinez Canillas <javierm(a)redhat.com>



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-10 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 20:33 [tpm2] [intel/tpm2-tools] dbaf76: lib: fix tpm2_print_usage() when tools have no opt GitHub

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.