QtQR crashes if any invalid text input in URL mode

Bug #1837085 reported by Shriramana Sharma
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QR Tools
Invalid
Undecided
Ramiro Algozino

Bug Description

Using 1.4-0~32~ubuntu18.04.1 I find that if you choose URL mode and press a digit or paste any invalid URL, then it simply crashes with following output in terminal:

$ qtqr
Traceback (most recent call last):
  File "/usr/bin/qtqr", line 556, in qrencode
    error = qr.encode()
  File "/usr/lib/python2.7/dist-packages/qrtools.py", line 147, in encode
    self.filename = filename or self.get_tmp_file()
  File "/usr/lib/python2.7/dist-packages/qrtools.py", line 143, in get_tmp_file
    hashlib.sha256(self.data_to_string()).hexdigest() + '.png'
  File "/usr/lib/python2.7/dist-packages/qrtools.py", line 137, in data_to_string
    return self.__class__.data_encode[self.data_type](self.data).encode('utf-8')
  File "/usr/lib/python2.7/dist-packages/qrtools.py", line 57, in encode_url
    raise QR.EncodeError('Invalid URL provided!')
qrtools.EncodeError: Invalid URL provided!
Aborted (core dumped)

If an invalid URL is formed, then it should simply avoid outputting a QR code. It should not crash. Please fix this.

Thank you.

Revision history for this message
Ramiro Algozino (algozino) wrote :

Hello,

I can't replicate the error. Opening QtQR, selecting URL from the data type drop down and writing anything on the URLdoesn't trigger any error on my test machine (Ubuntu 18.04).

Are you using the daily PPA version? It's seems that you are, but please double check. If after updating to the latest version you keep having the same issue please make a step by step example so I can try to replicate it.

Changed in qr-tools:
status: New → Invalid
assignee: nobody → Ramiro Algozino (algozino)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.