Skip to content

Commit eb6c342

Browse files
Brian C. Youngandi34
authored andcommitted
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)
1 parent 784d91f commit eb6c342

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

uri.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "libxml.h"
1313

1414
#include <string.h>
15+
#include <limits.h>
1516

1617
#include <libxml/xmlmemory.h>
1718
#include <libxml/uri.h>
@@ -303,6 +304,8 @@ xmlParse3986Port(xmlURIPtr uri, const char **str)
303304
uri->port = uri->port * 10 + (*cur - '0');
304305
cur++;
305306
}
307+
if (uri != NULL)
308+
uri->port = uri->port & USHRT_MAX; /* port value modulo INT_MAX+1 */
306309
*str = cur;
307310
return(0);
308311
}

0 commit comments

Comments
 (0)