Strings/numbers distinction fix (following JSON::PP) #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear Aristotle,
First of all, thanks a lot for bringing this software to public.
Recently, we've run into an issue in one of our customer's production environment causing qBittorrent to fail with
invalid 'name' of torrent (possible exploit attempt)
whenever a torrent generated by our CMS is getting added. After investigating for a while, it was found out that this only happens for torrents containing files with as least one path component looking like a number (e.g. year) due to an implicit conversion to i causing qBittorrent to confuse.In it's turn, this led me to the following notice in Bencode docs:
Actually, it is not true that strings and numbers are practically indistinguishable in Perl - although it's correct that it is not somewhat normally needed unless for someone trying to build up a serializer for a format sensitive to that.
So, please let me share a simple yet effective solution found in JSON::PP source code with you. We're already using it in production in order to avoid this problem.
The drawback of this approach which may make you potentially reluctant to approve this PR is that in this way, we have to remove use warnings; to avoid unnecessary warnings in runtime. Although personally I find that a small sacrifice. In any way, I'm always open to discussion.
Best Regards,
Valentin