summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2006-04-08 03:01:20 +0000
committerJason Stubbs <jstubbs@gentoo.org>2006-04-08 03:01:20 +0000
commit7cdc6575cb5fe4abdff89f1a8680eef7254a2fbd (patch)
tree6194616332cb1047ed052b2f80578e117545af6f /pym/portage.py
parenta52d8f3e5542489cc1b466c850455d21689fbfdd (diff)
downloadportage-7cdc6575cb5fe4abdff89f1a8680eef7254a2fbd.tar.gz
portage-7cdc6575cb5fe4abdff89f1a8680eef7254a2fbd.tar.bz2
portage-7cdc6575cb5fe4abdff89f1a8680eef7254a2fbd.zip
Protect string indexes during input stripping in dep_getkey and dep_getcpv.
Bug #129193 svn path=/main/trunk/; revision=3094
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 2dc324865..00d87dbd6 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3208,19 +3208,17 @@ def dep_zapdeps(unreduced,reduced,myroot,use_binaries=0):
def dep_getkey(mydep):
- if not len(mydep):
- return mydep
- if mydep[0]=="*":
+ if mydep and mydep[0]=="*":
mydep=mydep[1:]
- if mydep[-1]=="*":
+ if mydep and mydep[-1]=="*":
mydep=mydep[:-1]
- if mydep[0]=="!":
+ if mydep and mydep[0]=="!":
mydep=mydep[1:]
if mydep[:2] in [ ">=", "<=" ]:
mydep=mydep[2:]
elif mydep[:1] in "=<>~":
mydep=mydep[1:]
- if isspecific(mydep):
+ if mydep and isspecific(mydep):
mysplit=catpkgsplit(mydep)
if not mysplit:
return mydep
@@ -3229,13 +3227,11 @@ def dep_getkey(mydep):
return mydep
def dep_getcpv(mydep):
- if not len(mydep):
- return mydep
- if mydep[0]=="*":
+ if mydep and mydep[0]=="*":
mydep=mydep[1:]
- if mydep[-1]=="*":
+ if mydep and mydep[-1]=="*":
mydep=mydep[:-1]
- if mydep[0]=="!":
+ if mydep and mydep[0]=="!":
mydep=mydep[1:]
if mydep[:2] in [ ">=", "<=" ]:
mydep=mydep[2:]