aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian C. Young <bcyoung@google.com>2017-04-05 09:31:12 -0700
committergitbuildkicker <android-build@google.com>2017-04-17 16:24:08 -0700
commit51e0cb2e5ec18eaf6fb331bc573ff27b743898f4 (patch)
tree7d6926695711aae8f8ca71b97d935d3d3d0c5f92
parent3f571b1bb85cf56903f06bab3a820182115c5541 (diff)
downloadandroid_external_libxml2-51e0cb2e5ec18eaf6fb331bc573ff27b743898f4.tar.gz
android_external_libxml2-51e0cb2e5ec18eaf6fb331bc573ff27b743898f4.tar.bz2
android_external_libxml2-51e0cb2e5ec18eaf6fb331bc573ff27b743898f4.zip
DO NOT MERGE: Use correct limit for port values
no upstream report yet, add it here when we have it issue found & patch by nmehta@ Bug: 36555370 Change-Id: Ibf1efea554b95f514e23e939363d608021de4614 (cherry picked from commit b62884fb49fe92081e414966d9b5fe58250ae53c)
-rw-r--r--uri.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/uri.c b/uri.c
index 2bd5720d..b32ef10a 100644
--- a/uri.c
+++ b/uri.c
@@ -12,6 +12,7 @@
#include "libxml.h"
#include <string.h>
+#include <limits.h>
#include <libxml/xmlmemory.h>
#include <libxml/uri.h>
@@ -334,7 +335,7 @@ xmlParse3986Port(xmlURIPtr uri, const char **str)
cur++;
}
if (uri != NULL)
- uri->port = port & INT_MAX; /* port value modulo INT_MAX+1 */
+ uri->port = port & USHRT_MAX; /* port value modulo INT_MAX+1 */
*str = cur;
return(0);
}