shithub: zuke

Download patch

ref: 108260c329f31c919d3ce9f4eb7a51dd88a32919
parent: 284c31aee8f0a9027fe6bd8903a06653bf35e22d
author: Sigrid Haflínudóttir <[email protected]>
date: Thu Jun 11 09:51:00 EDT 2020

icy: don't touch the path

--- a/icy.c
+++ b/icy.c
@@ -1,16 +1,19 @@
 int
 icyfill(Meta *m)
 {
-	char *s, *e, *p, *d, tmp[128];
+	char *s, *e, *p, *path, *d;
 	int f, r, n;
 
-	s = strchr(m->path, ':')+3;
+	path = strdup(m->path);
+	s = strchr(path, ':')+3;
 	if((e = strchr(s, '/')) != nil)
 		*e++ = 0;
 	if((p = strchr(s, ':')) != nil)
 		*p = '!';
-	sprint(tmp, "tcp!%s", s);
-	d = netmkaddr(tmp, "tcp", "80");
+	p = smprint("tcp!%s", s);
+	free(path);
+	d = netmkaddr(p, "tcp", "80");
+	free(p);
 	if((f = dial(d, nil, nil, nil)) < 0)
 		return -1;
 	fprint(f, "GET /%s HTTP/0.9\r\nIcy-MetaData: 1\r\n\r\n", e ? e : "");