delta2hdx / jsunpack-n

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

Uncaught Exception during RegEx matching causes abrupt program termination #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Caused by an uncaught exception in line 486:
jars = re.findall('<(applet|object)([^>]*)?[ 
]+archive=\\\\?[\\\'"]?(.*?)\\\\?[\\\'"> ]', data, re.IGNORECASE)

What steps will reproduce the problem?
Processing of various http traffic on normal web traffic, about once every 200 
files I encountered.

I have had this error at least 40 times now and it breaks my threads while 
calling jsunpack as a library so I can't do anything about it!?

What is the expected output? What do you see instead?
The program should catch the exception and not terminate but it terminates.

What version of the product are you using? On what operating system?
r58 on Ubuntu 11.04 64bit

Here is an example for it:
Exception in thread Thread-19:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 132, in __bootstrap_inner
    self.run()
  File "/home/user/test.py", line 102, in run
    file_worker(self.inf)
  File "/home/user/test.py", line 67, in file_worker
    mimpact, impactmessages) = execute_jsunpack()
  File "/home/user/test.py", line 32, in execute_jsunpack
    js_prev_rooturl)
  File "/home/user/jsunpack/jsunpackn.py", line 137, in __init__
    self.main_decoder(mydata,myfile)
  File "/home/user/jsunpack/jsunpackn.py", line 1027, in main_decoder
    jsinurls = self.find_urls(predecoded,tcpaddr)
  File "/home/user/jsunpack/jsunpackn.py", line 486, in find_urls
    jars = re.findall('<(applet|object)([^>]*)?[ ]+archive=\\\\?[\\\'"]?(.*?)\\\\?[\\\'"> ]', data, re.IGNORECASE)
  File "/usr/lib/python2.7/re.py", line 177, in findall
    return _compile(pattern, flags).findall(string)
  File "/usr/lib/python2.7/re.py", line 245, in _compile
    raise error, v # invalid expression
error: nothing to repeat

Original issue reported on code.google.com by ali.iki...@gmail.com on 26 Jul 2011 at 1:17

GoogleCodeExporter commented 9 years ago
I fixed it yesterday, please svn up to r59.

Original comment by urul...@gmail.com on 26 Jul 2011 at 2:50