libisu: properly handle nulls in isu_pkg_get_name/isu_pkg_get_version 11/318111/1
authorAdam Michalski <a.michalski2@partner.samsung.com>
Tue, 24 Sep 2024 17:20:42 +0000 (19:20 +0200)
committerAdam Michalski <a.michalski2@partner.samsung.com>
Tue, 24 Sep 2024 17:20:42 +0000 (19:20 +0200)
commitda8ed37f51b87605da01ed1b16f73cdefbed3dd5
tree632881151c2e58a96df8092e9977071f9f0791b4
parent320133421b2c98f725ab118a3fccb96f405d82df
libisu: properly handle nulls in isu_pkg_get_name/isu_pkg_get_version

This commit fixes the incorrect dereferencing of pointers when
retrieving data from the name/version members of the pkg_info
structure in the isu_pkg_get_name/isu_pkg_get_version functions
of the libisu public API.

Although a situation where an instance of the pkg_info structure is
correctly allocated, but its name/version components are NULL, should
not occur during normal usage, public functions must be resilient to
such malformed arguments and respond with an appropriate error rather
than a segfault.

Change-Id: I641b003568a0db79eab79f192c2f612bb6900721
src/libisu/libisu.c