Merge "Suppress a boundary check warning"
diff --git a/xpath.c b/xpath.c
index d9d902c..8900313 100644
--- a/xpath.c
+++ b/xpath.c
@@ -2806,7 +2806,7 @@
 
 	    /* Finally copy result back to caller */
 	    size = strlen(work) + 1;
-	    if (size > buffersize) {
+	    if (size > buffersize && buffersize <= (int)sizeof(work)) {
 		work[buffersize - 1] = 0;
 		size = buffersize;
 	    }