From 566ac9e3dfb5d05ab83f81f81adf3810a8f69ebe Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 31 Mar 2017 16:46:44 +0300 Subject: Fix signature_manifest ctor to check for end of stream --- bpkg/manifest | 2 ++ bpkg/manifest.cxx | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'bpkg') diff --git a/bpkg/manifest b/bpkg/manifest index 19dd960..8ad9512 100644 --- a/bpkg/manifest +++ b/bpkg/manifest @@ -23,6 +23,8 @@ namespace bpkg { using strings = std::vector; + // @@ Let's create with "basic" package types. + // class LIBBPKG_EXPORT version { public: diff --git a/bpkg/manifest.cxx b/bpkg/manifest.cxx index 54627e7..107c2fe 100644 --- a/bpkg/manifest.cxx +++ b/bpkg/manifest.cxx @@ -705,7 +705,7 @@ namespace bpkg // used for version constrains rather than actual releases. // if (version.release && version.release->empty ()) - bad_name ("invalid package version release"); + bad_value ("invalid package version release"); } else if (n == "summary") { @@ -1242,8 +1242,6 @@ namespace bpkg s.next ("package-email", add_comment (*package_email, package_email->comment)); - - for (const auto& d: dependencies) s.next ("depends", (d.conditional @@ -2155,6 +2153,13 @@ namespace bpkg bad_value ("no sha256sum specified"); else if (signature.empty ()) bad_value ("no signature specified"); + + // Make sure this is the end. + // + nv = p.next (); + if (!nv.empty ()) + throw parsing (p.name (), nv.name_line, nv.name_column, + "single signature manifest expected"); } void signature_manifest:: -- cgit v1.1