Change test

I thought that an example where the user inputs a URL is more realistic.
Because if your operating system is already hacked then you are already screwed.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
This commit is contained in:
Martin Vrachev 2019-02-13 10:52:12 +02:00 committed by Cosmin Cojocar
parent 8048b15efa
commit 9cdfec40ca

View file

@ -323,9 +323,14 @@ import (
"io/ioutil" "io/ioutil"
"fmt" "fmt"
"os" "os"
"bufio"
) )
func main() { func main() {
url := os.Getenv("tainted_url") in := bufio.NewReader(os.Stdin)
url, err := in.ReadString('\n')
if err != nil {
panic(err)
}
resp, err := http.Get(url) resp, err := http.Get(url)
if err != nil { if err != nil {
panic(err) panic(err)