Step to reproduce:
package-query -Qs firefox -f "%t"
or
package-query -Qs firefox -f ""
That issue is rare but it's a segfault after all.
It comes from util.c, string_t.s is NULL as long as there is nothing to add (including empty string). Then pkg_to_str return NULL instead of empty string and print_package doesn't handle it.
Step to reproduce:
package-query -Qs firefox -f "%t"
orpackage-query -Qs firefox -f ""
That issue is rare but it's a segfault after all.
It comes from util.c, string_t.s is NULL as long as there is nothing to add (including empty string). Then pkg_to_str return NULL instead of empty string and print_package doesn't handle it.