Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: third_party/libxml/src/uri.c

Issue 2797923004: Improve XML serialization, URI parsing, and XPath node set processing. (Closed)
Patch Set: Rebase. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libxml/src/parser.c ('k') | third_party/libxml/src/valid.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * uri.c: set of generic URI related routines 2 * uri.c: set of generic URI related routines
3 * 3 *
4 * Reference: RFCs 3986, 2732 and 2373 4 * Reference: RFCs 3986, 2732 and 2373
5 * 5 *
6 * See Copyright for the status of this software. 6 * See Copyright for the status of this software.
7 * 7 *
8 * daniel@veillard.com 8 * daniel@veillard.com
9 */ 9 */
10 10
11 #define IN_LIBXML 11 #define IN_LIBXML
12 #include "libxml.h" 12 #include "libxml.h"
13 13
14 #include <string.h> 14 #include <string.h>
15 #include <limits.h>
15 16
16 #include <libxml/xmlmemory.h> 17 #include <libxml/xmlmemory.h>
17 #include <libxml/uri.h> 18 #include <libxml/uri.h>
18 #include <libxml/globals.h> 19 #include <libxml/globals.h>
19 #include <libxml/xmlerror.h> 20 #include <libxml/xmlerror.h>
20 21
21 /** 22 /**
22 * MAX_URI_LENGTH: 23 * MAX_URI_LENGTH:
23 * 24 *
24 * The definition of the URI regexp in the above RFC has no size limit 25 * The definition of the URI regexp in the above RFC has no size limit
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 const char *cur = *str; 328 const char *cur = *str;
328 unsigned port = 0; /* unsigned for defined overflow behavior */ 329 unsigned port = 0; /* unsigned for defined overflow behavior */
329 330
330 if (ISA_DIGIT(cur)) { 331 if (ISA_DIGIT(cur)) {
331 while (ISA_DIGIT(cur)) { 332 while (ISA_DIGIT(cur)) {
332 port = port * 10 + (*cur - '0'); 333 port = port * 10 + (*cur - '0');
333 334
334 cur++; 335 cur++;
335 } 336 }
336 if (uri != NULL) 337 if (uri != NULL)
337 » uri->port = port & INT_MAX; /* port value modulo INT_MAX+1 */ 338 » uri->port = port & USHRT_MAX; /* port value modulo USHRT_MAX+1 */
338 *str = cur; 339 *str = cur;
339 return(0); 340 return(0);
340 } 341 }
341 return(1); 342 return(1);
342 } 343 }
343 344
344 /** 345 /**
345 * xmlParse3986Userinfo: 346 * xmlParse3986Userinfo:
346 * @uri: pointer to an URI structure 347 * @uri: pointer to an URI structure
347 * @str: the string to analyze 348 * @str: the string to analyze
(...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2558 } 2559 }
2559 #endif 2560 #endif
2560 memset(&temp, 0, sizeof(temp)); 2561 memset(&temp, 0, sizeof(temp));
2561 temp.path = (char *) cal; 2562 temp.path = (char *) cal;
2562 ret = xmlSaveUri(&temp); 2563 ret = xmlSaveUri(&temp);
2563 xmlFree(cal); 2564 xmlFree(cal);
2564 return(ret); 2565 return(ret);
2565 } 2566 }
2566 #define bottom_uri 2567 #define bottom_uri
2567 #include "elfgcchack.h" 2568 #include "elfgcchack.h"
OLDNEW
« no previous file with comments | « third_party/libxml/src/parser.c ('k') | third_party/libxml/src/valid.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698