Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 634632 - app-text/wgetpaste-2.28-r1 gets confused by string "Location:" in its input
Summary: app-text/wgetpaste-2.28-r1 gets confused by string "Location:" in its input
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Maxim Koltsov (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-18 12:28 UTC by Ulrich Müller
Modified: 2019-08-27 06:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2017-10-18 12:28:30 UTC
If the string "Location:" occurs in the input, wgetpaste gets confused and outputs garbage as the pastebin's location:

   $ echo "abc def Location: http://example.com/" | wgetpaste
   Your paste can be seen here: http://example.com/</textarea>
Comment 1 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-02-23 20:21:37 UTC
because the `get_url()` function has a greedy regexp like:

sed -n -e 's|^.*Location: \(https\{0,1\}://[^ ]*\).*$|\1|p' <<< "$*"

I do not know will this help or not if we are getting rid of ^.* (I mean, surely this will help, but I think we gonna face some tricky cases, maybe)
Comment 2 Louis Sautier (sbraz) gentoo-dev 2019-08-27 06:59:46 UTC
Looks like this works with 2.29