aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-11-26 22:50:00 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-11-26 22:50:00 +0300
commit7801dc763e50fcecc8a370f78fe33b5e86e1c8a3 (patch)
treea601cc6c173b8e9dada0b3b7981b3e6311ab9101 /libbuild2
parente964348919b8d1334d655bd3f002c54a2bbdf879 (diff)
Fix crashing on unhandled invalid_path thrown by cc::common::pkgconfig_load()
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/cc/pkgconfig.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx
index 516746b..bbcddf9 100644
--- a/libbuild2/cc/pkgconfig.cxx
+++ b/libbuild2/cc/pkgconfig.cxx
@@ -972,13 +972,23 @@ namespace build2
else
p = string (o, 2);
- dir_path d (move (p));
+ try
+ {
+ dir_path d (move (p));
- if (d.relative ())
- fail << "relative -L directory in '" << lflags () << "'" <<
- info << "while parsing pkg-config --libs " << pc.path;
+ if (d.relative ())
+ fail << "relative -L directory '" << d << "' in '"
+ << lflags () << "'" <<
+ info << "while parsing pkg-config --libs " << pc.path;
- usrd->push_back (move (d));
+ usrd->push_back (move (d));
+ }
+ catch (const invalid_path& e)
+ {
+ fail << "invalid -L directory '" << e.path << "' in '"
+ << lflags () << "'" <<
+ info << "while parsing pkg-config --libs " << pc.path;
+ }
}
}
}