tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

07_always_store_rawnames.patch (3768B)


      1 diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
      2 --- a/expat/lib/xmlparse.c
      3 +++ b/expat/lib/xmlparse.c
      4 @@ -491,6 +491,13 @@ static enum XML_Error doProlog(XML_Parse
      5                                enum XML_Account account);
      6 static enum XML_Error processInternalEntity(XML_Parser parser, ENTITY *entity,
      7                                             XML_Bool betweenDecl);
      8 +/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
      9 +static enum XML_Error doContentInternal(XML_Parser parser, int startTagLevel,
     10 +                                        const ENCODING *enc, const char *start,
     11 +                                        const char *end, const char **endPtr,
     12 +                                        XML_Bool haveMore,
     13 +                                        enum XML_Account account);
     14 +/* END MOZILLA CHANGE */
     15 static enum XML_Error doContent(XML_Parser parser, int startTagLevel,
     16                                 const ENCODING *enc, const char *start,
     17                                 const char *end, const char **endPtr,
     18 @@ -2756,10 +2763,14 @@ contentProcessor(XML_Parser parser, cons
     19   enum XML_Error result = doContent(
     20       parser, 0, parser->m_encoding, start, end, endPtr,
     21       (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_ACCOUNT_DIRECT);
     22 +/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
     23 +#if 0
     24   if (result == XML_ERROR_NONE) {
     25     if (! storeRawNames(parser))
     26       return XML_ERROR_NO_MEMORY;
     27   }
     28 +#endif
     29 +/* END MOZILLA CHANGE */
     30   return result;
     31 }
     32 
     33 @@ -2872,6 +2883,24 @@ externalEntityContentProcessor(XML_Parse
     34       = doContent(parser, 1, parser->m_encoding, start, end, endPtr,
     35                   (XML_Bool)! parser->m_parsingStatus.finalBuffer,
     36                   XML_ACCOUNT_ENTITY_EXPANSION);
     37 +/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
     38 +#if 0
     39 +  if (result == XML_ERROR_NONE) {
     40 +    if (! storeRawNames(parser))
     41 +      return XML_ERROR_NO_MEMORY;
     42 +  }
     43 +#endif
     44 +/* END MOZILLA CHANGE */
     45 +  return result;
     46 +}
     47 +
     48 +static enum XML_Error
     49 +doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
     50 +          const char *s, const char *end, const char **nextPtr,
     51 +          XML_Bool haveMore, enum XML_Account account) {
     52 +/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
     53 +  enum XML_Error result = doContentInternal(parser, startTagLevel, enc, s, end,
     54 +                                            nextPtr, haveMore, account);
     55   if (result == XML_ERROR_NONE) {
     56     if (! storeRawNames(parser))
     57       return XML_ERROR_NO_MEMORY;
     58 @@ -2880,9 +2909,10 @@ externalEntityContentProcessor(XML_Parse
     59 }
     60 
     61 static enum XML_Error
     62 -doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
     63 -          const char *s, const char *end, const char **nextPtr,
     64 -          XML_Bool haveMore, enum XML_Account account) {
     65 +doContentInternal(XML_Parser parser, int startTagLevel, const ENCODING *enc,
     66 +                  const char *s, const char *end, const char **nextPtr,
     67 +                  XML_Bool haveMore, enum XML_Account account) {
     68 +/* END MOZILLA CHANGE */
     69   /* save one level of indirection */
     70   DTD *const dtd = parser->m_dtd;
     71 
     72 @@ -6038,10 +6068,14 @@ internalEntityProcessor(XML_Parser parse
     73                        parser->m_encoding, s, end, nextPtr,
     74                        (XML_Bool)! parser->m_parsingStatus.finalBuffer,
     75                        XML_ACCOUNT_DIRECT);
     76 +/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
     77 +#if 0
     78     if (result == XML_ERROR_NONE) {
     79       if (! storeRawNames(parser))
     80         return XML_ERROR_NO_MEMORY;
     81     }
     82 +#endif
     83 +/* END MOZILLA CHANGE */
     84     return result;
     85   }
     86 }