Commits

ma...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed a67db69

Croak with better error messages with empty strings

  • Participants
  • Parent commits dc2ceda

Comments (0)

Files changed (1)

         ProxyObject * proxy;
     CODE:
         ptr = SvPV(string, len);
+        if (len == 0) {
+            croak("Empty string");
+        }
         ctxt = xmlCreateMemoryParserCtxt(ptr, len);
         if (ctxt == NULL) {
             croak("Couldn't create memory parser context: %s", strerror(errno));
         ProxyObject * proxy;
     CODE:
         ptr = SvPV(string, len);
+        if (len == 0) {
+            croak("Empty string");
+        }
         
         LibXML_error = newSVpv("", 0);