audk/CryptoPkg
Laszlo Ersek eb520d94db CryptoPkg/Crt: turn strchr() into a function (CVE-2019-14553)
According to the ISO C standard, strchr() is a function. We #define it as
a macro. Unfortunately, our macro evaluates the first argument ("str")
twice. If the expression passed for "str" has side effects, the behavior
may be undefined.

In a later patch in this series, we're going to resurrect "inet_pton.c"
(originally from the StdLib package), which calls strchr() just like that:

  strchr((xdigits = xdigits_l), ch)
  strchr((xdigits = xdigits_u), ch)

To enable this kind of function call, turn strchr() into a function.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Sivaraman Nainar <sivaramann@amiindia.co.in>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=960
CVE: CVE-2019-14553
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2019-11-02 12:07:25 +01:00
..
Include/Library CryptoPkg/TlsLib: Add the new API "TlsSetVerifyHost" (CVE-2019-14553) 2019-11-02 12:07:23 +01:00
Library CryptoPkg/Crt: turn strchr() into a function (CVE-2019-14553) 2019-11-02 12:07:25 +01:00
CryptoPkg.dec CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
CryptoPkg.dsc CryptoPkg: Add Null instance of the BaseCryptLib class 2019-10-23 18:37:19 -07:00
CryptoPkg.uni CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
CryptoPkgExtra.uni CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00