aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-30 12:44:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-30 12:44:26 +0000
commitcabe1e40deeeacb4ebd0fbc7eab1c8c311984888 (patch)
tree9ed0942de1f0249d6be045fabb3a73fed112d348
parentb99a274520870ce44d4aebd7da1c5bbde0bd5f5c (diff)
downloadpaludis-cabe1e40deeeacb4ebd0fbc7eab1c8c311984888.tar.gz
paludis-cabe1e40deeeacb4ebd0fbc7eab1c8c311984888.tar.xz
Don't infinite loop on syntax screwups
-rw-r--r--paludis/package_dep_atom.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/paludis/package_dep_atom.cc b/paludis/package_dep_atom.cc
index 86ba431..638a529 100644
--- a/paludis/package_dep_atom.cc
+++ b/paludis/package_dep_atom.cc
@@ -73,7 +73,7 @@ PackageDepAtom::PackageDepAtom(const std::string & s) :
if (p >= s.length())
throw InternalError(PALUDIS_HERE, "todo"); /// \bug
q = s.find('-', q + 1);
- if (++q >= s.length())
+ if ((std::string::npos == q) || (++q >= s.length()))
throw InternalError(PALUDIS_HERE, "todo"); /// \bug
if (s.at(q) >= '0' && s.at(q) <= '9')
break;