nxbdi / jsunpack-n

Automatically exported from code.google.com/p/jsunpack-n
GNU General Public License v2.0
2 stars 0 forks source link

find_urls fails when data contains the text " archive=" #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a file with the following content (note the space preceeding the word 
archive:
' archive="blah.jar"'

What is the expected output? What do you see instead?
Expect jsunpackn.py not to fall over, however an error is occurring producing a 
traceback as shown below:

Traceback (most recent call last):
  File ".jsunpackn.py", line 1363, in <module>
    main()
  File ".jsunpackn.py", line 1304, in main
    js = jsunpack(file, ['',mydata,file], options)
  File ".jsunpackn.py", line 1027, in main decoder
    jsinurls = self.find_urls(predecoded, tcpaddr)
  File ".jsunpackn.py", line 486, in find_urls
    jars = re.findall('<(applet|object)([^>]*)?[ ]+archive=\\\\?[\\\'"]?(.*?)\\\\?[\\\'"> ]', data, re.IGNORECASE)
  File "/usr/local/lib64/python2.7/re.py", line 177, in findall
    return_compile(pattern, flags).findall(string)
  File "/usr/local/lib64/python2.7/re.py", line 244, in _compile
    raise error, v # invalidexpression
sre_constants.error: nothing to repeat

What version of the product are you using? On what operating system?
r58 of junpackn.py, running on redhat linux.

Please provide any additional information below.
Have had a quick play around and it appears the issue relates to the regex 
being supplied:
'<(applet|object)([^>]*)?[ ]+archive=\\\\?[\\\'"]?(.*?)\\\\?[\\\'"> ]'
in particular the text "([^>]*)?" seems to trigger the error.

Original issue reported on code.google.com by mmatt...@gmail.com on 12 Jul 2011 at 3:30

GoogleCodeExporter commented 9 years ago
fixed in r59 by removing the ?, thanks for reporting.

Original comment by urul...@gmail.com on 25 Jul 2011 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by urul...@gmail.com on 25 Jul 2011 at 2:42