hang on urlencoded utf8 text in message #1119

Closed
opened 2018-02-07 16:47:57 +01:00 by sss123next · 3 comments
sss123next commented 2018-02-07 16:47:57 +01:00 (Migrated from github.com)

https://ru.wikipedia.org/wiki/Opus_(%D0%BA%D0%BE%D0%B4%D0%B5%D0%BA)
this link inside message cause pybitmessage to hang

`https://ru.wikipedia.org/wiki/Opus_(%D0%BA%D0%BE%D0%B4%D0%B5%D0%BA)` this link inside message cause pybitmessage to hang
PeterSurda commented 2018-02-07 17:01:41 +01:00 (Migrated from github.com)

Thanks, I'll look at it.

Thanks, I'll look at it.
g1itch commented 2018-02-07 17:21:24 +01:00 (Migrated from github.com)

And it seems to hang here:

import re
uriregex1 = re.compile(r'(?i)\b((?:(https?|ftp|bitcoin):(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?]))')
data = u'https://ru.wikipedia.org/wiki/Opus_(%D0%BA%D0%BE%D0%B4%D0%B5%D0%BA)'
uriregex1.sub(r'<a href="\1">\1</a>', data)

And it doesn't hang without brackets in data string.

And it seems to hang [here](/blob/v0.6/src/bitmessageqt/safehtmlparser.py#L106): ```python import re uriregex1 = re.compile(r'(?i)\b((?:(https?|ftp|bitcoin):(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?]))') data = u'https://ru.wikipedia.org/wiki/Opus_(%D0%BA%D0%BE%D0%B4%D0%B5%D0%BA)' uriregex1.sub(r'<a href="\1">\1</a>', data) ``` And it doesn't hang without brackets in `data` string.
PeterSurda commented 2018-02-08 15:41:39 +01:00 (Migrated from github.com)

fixed in f870bcc6f7

fixed in f870bcc6f7bc03ae4fa4380aa8647c60d44ec190
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bitmessage/PyBitmessage-2024-12-03#1119
No description provided.