shithub: riscv

Download patch

ref: 660f54b19894abff8f8afc70432ba7285cff88da
parent: 71c57070c61d58f9ba41a511ed3790201bedead7
author: cinap_lenrek <[email protected]>
date: Sat Aug 1 12:18:02 EDT 2015

mothra: fix nil crash on missing name/src attributes for source/video/audio/embed/frame/iframe

--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -884,8 +884,10 @@
 			if(str && *str){
 				free(g.state->name);
 				g.state->name = strdup(str);
-			} else
+			} else if(g.state->link)
 				str = g.state->link;
+			else
+				str = "";
 			pl_htmloutput(&g, 0, str, 0);
 			free(g.state->link);
 			g.state->link=0;