]> git.ipfire.org Git - thirdparty/cups.git/commit
dest.c: Call cupsEnumDests() only if data.name is not NULL (fixes #719)
authorZdenek Dohnal <zdohnal@redhat.com>
Tue, 6 Jun 2023 08:45:37 +0000 (10:45 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Tue, 6 Jun 2023 08:45:37 +0000 (10:45 +0200)
commitc40c3be43a7a7c4d929ae681bec24bc5ee17c002
tree6dd56f7339878dadf31a4b575d0a034267a5cc32
parentff9492ab5a1534137f65bf4671da647c1cb72ea2
dest.c: Call cupsEnumDests() only if data.name is not NULL (fixes #719)

Fixes regression created by #452 - in case there is no default
destination and `cupsGetNamedDest()` is called to get one (by calling it
with argument `name` as NULL), the function crashes.

It happens because we try to look for the default printer on the network
(where we access `data.name`, which is NULL, in callback), but we never
found out the printer's name.

Original fix by Emilio Cobos Alvarez.
cups/dest.c