Suppress a boundary check warning
Bug: 6296965
When we enable boundary check in gcc 4.6, we get a compiler error in libxml
code. The xml code seems likely safe, however, to suppress the warning
we need to strengthen the check. We will report the issue to upstream
xml for best action.
Change-Id: Ib9670a994d741102a287a9efe079147047abd936
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;
}