| author | Raphaël Hertzog <hertzog@debian.org> | |
| Fri, 10 Aug 2012 12:48:19 +0000 (14:48 +0200) | ||
| committer | Raphaël Hertzog <hertzog@debian.org> | |
| Fri, 10 Aug 2012 13:09:33 +0000 (15:09 +0200) |
Giving an empty parameter seems pretty useless, but it can also be
the result of user errors like using “-f "${Package}"” instead
of “-f '${Package}'” and the segfault does not really help to
understand one's fault.
This commit fixes pkg_format_parse() to define the error message
when the function had nothing to parse. It already returned
the appropriate NULL value but the fact that the error message
was uninitialized resulted in the segfault.
the result of user errors like using “-f "${Package}"” instead
of “-f '${Package}'” and the segfault does not really help to
understand one's fault.
This commit fixes pkg_format_parse() to define the error message
when the function had nothing to parse. It already returned
the appropriate NULL value but the fact that the error message
was uninitialized resulted in the segfault.
| debian/changelog | patch | blob | history | |
| lib/dpkg/pkg-format.c | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
[ Raphaël Hertzog ]
* Fix dpkg-source regression in "3.0 (quilt)" source packages while
unapplying patches that remove all files in a directory. Closes: #683547
+ * Fix segfault of “dpkg-query -W -f ''”.
[ Updated programs translations ]
* Czech (Miroslav Kure).
diff --git a/lib/dpkg/pkg-format.c b/lib/dpkg/pkg-format.c
--- a/lib/dpkg/pkg-format.c
+++ b/lib/dpkg/pkg-format.c
}
}
+ if (!head)
+ dpkg_put_error(err, _("may not be empty string"));
+
return head;
}
