[PATCH] erofs-utils: lib: fix potential NULL pointer dereference in docker_config.c
Gao Xiang
hsiangkao at linux.alibaba.com
Mon Mar 16 15:35:02 AEDT 2026
On 2026/3/16 03:14, Sri Lasya wrote:
> Signed-off-by: Sri Lasya <lasyaprathipati at gmail.com>
> ---
> lib/remotes/docker_config.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/remotes/docker_config.c b/lib/remotes/docker_config.c
> index 00db1bb..b346ee8 100644
> --- a/lib/remotes/docker_config.c
> +++ b/lib/remotes/docker_config.c
> @@ -38,7 +38,6 @@ static char *docker_config_path(void)
> {
> const char *dir;
> char *path = NULL;
> -
> dir = getenv("DOCKER_CONFIG");
> if (dir) {
> if (!*dir)
> @@ -203,6 +202,8 @@ int erofs_docker_config_lookup(const char *registry,
> }
>
> entry = json_object_iter_peek_value(&it);
> + if (!entry)
> + continue;
The patch format is broken, also Chengyu could you review it?
Thanks,
Gao Xiang
> if (json_object_object_get_ex(entry, "auth", &auth_field)) {
> b64 = json_object_get_string(auth_field);
> if (b64 && *b64) {
More information about the Linux-erofs
mailing list