shithub: libmujs

Download patch

ref: e2b59201d5049a8ad509b280e729a871756abc99
parent: eeea83a807beabb5106b762458c7fdf29970bd60
author: Tor Andersson <tor.andersson@artifex.com>
date: Tue Jun 11 11:48:26 EDT 2019

Issue 105: Fix NULL dereferencing in regexp compiler.

"x(?:)" parses to Cat(Char(x), Empty), but the compiler couldn't handle
an empty right hand side of the Cat node.

--- a/regexp.c
+++ b/regexp.c
@@ -637,10 +637,10 @@
 	Reinst *inst, *split, *jump;
 	int i;
 
+loop:
 	if (!node)
 		return;
 
-loop:
 	switch (node->type) {
 	case P_CAT:
 		compile(prog, node->x);