--- parser.c	2014-06-01 12:00:00.000000000 +0000
+++ parser.c	2014-06-01 12:00:00.000000000 +0000
@@ -9356,6 +9356,13 @@
 		    if (nsPush(ctxt, NULL, URL) > 0) nbNs++;
 skip_default_ns:
 		if (alloc != 0) xmlFree(attvalue);
+                if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
+                    break;
+                if (!IS_BLANK_CH(RAW)) {
+                    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
+                                   "attributes construct error\n");
+                    break;
+                }
 		SKIP_BLANKS;
 		continue;
 	    }
@@ -9429,6 +9436,13 @@
 		    if (nsPush(ctxt, attname, URL) > 0) nbNs++;
 skip_ns:
 		if (alloc != 0) xmlFree(attvalue);
+                if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
+                    break;
+                if (!IS_BLANK_CH(RAW)) {
+                    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
+                                   "attributes construct error\n");
+                    break;
+                }
 		SKIP_BLANKS;
 		if (ctxt->input->base != base) goto base_changed;
 		continue;
