--- lib/xmlparse.c.orig	2017-06-17 11:07:38.000000000 -0500
+++ lib/xmlparse.c	2017-06-20 20:28:38.000000000 -0500
@@ -623,7 +623,7 @@
 #define defaultExpandInternalEntities \
         (parser->m_defaultExpandInternalEntities)
 #define tagLevel (parser->m_tagLevel)
-#define buffer (parser->m_buffer)
+#define xbuffer (parser->m_buffer)
 #define bufferPtr (parser->m_bufferPtr)
 #define bufferEnd (parser->m_bufferEnd)
 #define parseEndByteIndex (parser->m_parseEndByteIndex)
@@ -901,7 +901,7 @@
   if (!parser)
     return parser;
 
-  buffer = NULL;
+  xbuffer = NULL;
   bufferLim = NULL;
 
   attsSize = INIT_ATTS_SIZE;
@@ -1017,8 +1017,8 @@
   attlistDeclHandler = NULL;
   entityDeclHandler = NULL;
   xmlDeclHandler = NULL;
-  bufferPtr = buffer;
-  bufferEnd = buffer;
+  bufferPtr = xbuffer;
+  bufferEnd = xbuffer;
   parseEndByteIndex = 0;
   parseEndPtr = NULL;
   declElementType = NULL;
@@ -1371,7 +1371,7 @@
   FREE((void *)attInfo);
 #endif
   FREE(groupConnector);
-  FREE(buffer);
+  FREE(xbuffer);
   FREE(dataBuf);
   FREE(nsAtts);
   FREE(unknownEncodingMem);
@@ -1841,14 +1841,14 @@
     XmlUpdatePosition(encoding, positionPtr, end, &position);
     nLeftOver = s + len - end;
     if (nLeftOver) {
-      if (buffer == NULL || nLeftOver > bufferLim - buffer) {
+      if (xbuffer == NULL || nLeftOver > bufferLim - xbuffer) {
         /* avoid _signed_ integer overflow */
         char *temp = NULL;
         const int bytesToAllocate = (int)((unsigned)len * 2U);
         if (bytesToAllocate > 0) {
-          temp = (buffer == NULL
+          temp = (xbuffer == NULL
                 ? (char *)MALLOC(bytesToAllocate)
-                : (char *)REALLOC(buffer, bytesToAllocate));
+                : (char *)REALLOC(xbuffer, bytesToAllocate));
         }
         if (temp == NULL) {
           errorCode = XML_ERROR_NO_MEMORY;
@@ -1856,13 +1856,13 @@
           processor = errorProcessor;
           return XML_STATUS_ERROR;
         }
-        buffer = temp;
-        bufferLim = buffer + bytesToAllocate;
+        xbuffer = temp;
+        bufferLim = xbuffer + bytesToAllocate;
       }
-      memcpy(buffer, end, nLeftOver);
+      memcpy(xbuffer, end, nLeftOver);
     }
-    bufferPtr = buffer;
-    bufferEnd = buffer + nLeftOver;
+    bufferPtr = xbuffer;
+    bufferEnd = xbuffer + nLeftOver;
     positionPtr = bufferPtr;
     parseEndPtr = bufferEnd;
     eventPtr = bufferPtr;
@@ -1969,23 +1969,23 @@
       return NULL;
     }
 #ifdef XML_CONTEXT_BYTES
-    keep = (int)(bufferPtr - buffer);
+    keep = (int)(bufferPtr - xbuffer);
     if (keep > XML_CONTEXT_BYTES)
       keep = XML_CONTEXT_BYTES;
     neededSize += keep;
 #endif  /* defined XML_CONTEXT_BYTES */
-    if (neededSize  <= bufferLim - buffer) {
+    if (neededSize  <= bufferLim - xbuffer) {
 #ifdef XML_CONTEXT_BYTES
-      if (keep < bufferPtr - buffer) {
-        int offset = (int)(bufferPtr - buffer) - keep;
-        memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep);
+      if (keep < bufferPtr - xbuffer) {
+        int offset = (int)(bufferPtr - xbuffer) - keep;
+        memmove(xbuffer, &xbuffer[offset], bufferEnd - bufferPtr + keep);
         bufferEnd -= offset;
         bufferPtr -= offset;
       }
 #else
-      memmove(buffer, bufferPtr, bufferEnd - bufferPtr);
-      bufferEnd = buffer + (bufferEnd - bufferPtr);
-      bufferPtr = buffer;
+      memmove(xbuffer, bufferPtr, bufferEnd - bufferPtr);
+      bufferEnd = xbuffer + (bufferEnd - bufferPtr);
+      bufferPtr = xbuffer;
 #endif  /* not defined XML_CONTEXT_BYTES */
     }
     else {
@@ -2009,26 +2009,26 @@
       bufferLim = newBuf + bufferSize;
 #ifdef XML_CONTEXT_BYTES
       if (bufferPtr) {
-        int keep = (int)(bufferPtr - buffer);
+        int keep = (int)(bufferPtr - xbuffer);
         if (keep > XML_CONTEXT_BYTES)
           keep = XML_CONTEXT_BYTES;
         memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep);
-        FREE(buffer);
-        buffer = newBuf;
-        bufferEnd = buffer + (bufferEnd - bufferPtr) + keep;
-        bufferPtr = buffer + keep;
+        FREE(xbuffer);
+        xbuffer = newBuf;
+        bufferEnd = xbuffer + (bufferEnd - bufferPtr) + keep;
+        bufferPtr = xbuffer + keep;
       }
       else {
         bufferEnd = newBuf + (bufferEnd - bufferPtr);
-        bufferPtr = buffer = newBuf;
+        bufferPtr = xbuffer = newBuf;
       }
 #else
       if (bufferPtr) {
         memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr);
-        FREE(buffer);
+        FREE(xbuffer);
       }
       bufferEnd = newBuf + (bufferEnd - bufferPtr);
-      bufferPtr = buffer = newBuf;
+      bufferPtr = xbuffer = newBuf;
 #endif  /* not defined XML_CONTEXT_BYTES */
     }
     eventPtr = eventEndPtr = NULL;
@@ -2152,12 +2152,12 @@
 #ifdef XML_CONTEXT_BYTES
   if (parser == NULL)
     return NULL;
-  if (eventPtr && buffer) {
+  if (eventPtr && xbuffer) {
     if (offset != NULL)
-      *offset = (int)(eventPtr - buffer);
+      *offset = (int)(eventPtr - xbuffer);
     if (size != NULL)
-      *size   = (int)(bufferEnd - buffer);
-    return buffer;
+      *size   = (int)(bufferEnd - xbuffer);
+    return xbuffer;
   }
 #else
   (void)parser;
