From 21ccf49464630cb9da7792d375f472c53717eecb Mon Sep 17 00:00:00 2001 From: Jonathan Kang Date: Thu, 12 Aug 2021 14:39:26 +0800 Subject: [PATCH] zypp: Fix crash when search string is NULL https://bugzilla.suse.com/show_bug.cgi?id=1179287 --- backends/zypp/pk-backend-zypp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp index 6da70348b..fca8ac032 100644 --- a/backends/zypp/pk-backend-zypp.cpp +++ b/backends/zypp/pk-backend-zypp.cpp @@ -3088,6 +3088,12 @@ backend_find_packages_thread (PkBackendJob *job, GVariant *params, gpointer user &_filters, &values); + if (values == NULL && values[0] == NULL) { + pk_backend_job_error_code (job, PK_ERROR_ENUM_PACKAGE_ID_INVALID, + "Empty search string is not supported."); + return; + } + ZyppJob zjob(job); ZYpp::Ptr zypp = zjob.get_zypp(); -- 2.31.1