[PATCH 2/3] tools: avoid potential null pointer dereference by GCC 10