public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-libs/expat/files: expat-2.1.0_beta2-move_setContext_call.patch
@ 2012-03-10 17:51 Samuli Suominen (ssuominen)
  0 siblings, 0 replies; 3+ messages in thread
From: Samuli Suominen (ssuominen) @ 2012-03-10 17:51 UTC (permalink / raw
  To: gentoo-commits

ssuominen    12/03/10 17:51:46

  Added:                expat-2.1.0_beta2-move_setContext_call.patch
  Log:
  Move call to setContext right after the setting of salt wrt #407555 using upstream patch. Thanks to Marien Zwart for bisecting the issue.
  
  (Portage version: 2.2.0_alpha90/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch?rev=1.1&content-type=text/plain

Index: expat-2.1.0_beta2-move_setContext_call.patch
===================================================================
http://bugs.gentoo.org/407555
http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmlparse.c?r1=1.168&r2=1.169
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=3500861&group_id=10127

--- lib/xmlparse.c
+++ lib/xmlparse.c
@@ -432,6 +432,9 @@
 getElementType(XML_Parser parser, const ENCODING *enc,
                const char *ptr, const char *end);
 
+static unsigned long generate_hash_secret_salt(void);
+static XML_Bool parsingSetup(XML_Parser parser);
+
 static XML_Parser
 parserCreate(const XML_Char *encodingName,
              const XML_Memory_Handling_Suite *memsuite,
@@ -695,22 +698,27 @@
   return rand();
 }
 
+static XML_Bool
+parsingSetup(XML_Parser parser)
+{
+    /* hash functions must be initialized before setContext() is called */
+    if (hash_secret_salt == 0)
+      hash_secret_salt = generate_hash_secret_salt();
+    if (parser != NULL && ns) {
+      /* implicit context only set for root parser, since child
+         parsers (i.e. external entity parsers) will inherit it
+      */
+      return setContext(parser, implicitContext);
+    }
+    return XML_TRUE;
+}
+
 XML_Parser XMLCALL
 XML_ParserCreate_MM(const XML_Char *encodingName,
                     const XML_Memory_Handling_Suite *memsuite,
                     const XML_Char *nameSep)
 {
-  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
-  if (parser != NULL && ns) {
-    /* implicit context only set for root parser, since child
-       parsers (i.e. external entity parsers) will inherit it
-    */
-    if (!setContext(parser, implicitContext)) {
-      XML_ParserFree(parser);
-      return NULL;
-    }
-  }
-  return parser;
+  return parserCreate(encodingName, memsuite, nameSep, NULL);
 }
 
 static XML_Parser
@@ -946,7 +954,7 @@
   poolClear(&temp2Pool);
   parserInit(parser, encodingName);
   dtdReset(_dtd, &parser->m_mem);
-  return setContext(parser, implicitContext);
+  return XML_TRUE;
 }
 
 enum XML_Status XMLCALL
@@ -1499,8 +1507,10 @@
     errorCode = XML_ERROR_FINISHED;
     return XML_STATUS_ERROR;
   case XML_INITIALIZED:
-    if (hash_secret_salt == 0)
-      hash_secret_salt = generate_hash_secret_salt();
+    if (!parsingSetup(parser)) {
+      errorCode = XML_ERROR_NO_MEMORY;
+      return XML_STATUS_ERROR;
+    }
   default:
     ps_parsing = XML_PARSING;
   }
@@ -1623,8 +1633,10 @@
     errorCode = XML_ERROR_FINISHED;
     return XML_STATUS_ERROR;
   case XML_INITIALIZED:
-    if (hash_secret_salt == 0)
-      hash_secret_salt = generate_hash_secret_salt();
+    if (!parsingSetup(parser)) {
+      errorCode = XML_ERROR_NO_MEMORY;
+      return XML_STATUS_ERROR;
+    }
   default:
     ps_parsing = XML_PARSING;
   }






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in dev-libs/expat/files: expat-2.1.0_beta2-move_setContext_call.patch
@ 2012-03-11  9:56 Samuli Suominen (ssuominen)
  0 siblings, 0 replies; 3+ messages in thread
From: Samuli Suominen (ssuominen) @ 2012-03-11  9:56 UTC (permalink / raw
  To: gentoo-commits

ssuominen    12/03/11 09:56:04

  Modified:             expat-2.1.0_beta2-move_setContext_call.patch
  Log:
  Update the upstream patch to more up to date revision
  
  (Portage version: 2.2.0_alpha90/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)

Revision  Changes    Path
1.2                  dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch?r1=1.1&r2=1.2

Index: expat-2.1.0_beta2-move_setContext_call.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-libs/expat/files/expat-2.1.0_beta2-move_setContext_call.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- expat-2.1.0_beta2-move_setContext_call.patch	10 Mar 2012 17:51:46 -0000	1.1
+++ expat-2.1.0_beta2-move_setContext_call.patch	11 Mar 2012 09:56:03 -0000	1.2
@@ -1,5 +1,5 @@
 http://bugs.gentoo.org/407555
-http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmlparse.c?r1=1.168&r2=1.169
+http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmlparse.c?r1=1.168&r2=1.170
 http://sourceforge.net/tracker/?func=detail&atid=110127&aid=3500861&group_id=10127
 
 --- lib/xmlparse.c
@@ -9,7 +9,7 @@
                 const char *ptr, const char *end);
  
 +static unsigned long generate_hash_secret_salt(void);
-+static XML_Bool parsingSetup(XML_Parser parser);
++static XML_Bool startParsing(XML_Parser parser);
 +
  static XML_Parser
  parserCreate(const XML_Char *encodingName,
@@ -18,13 +18,13 @@
    return rand();
  }
  
-+static XML_Bool
-+parsingSetup(XML_Parser parser)
++static XML_Bool  /* only valid for root parser */
++startParsing(XML_Parser parser)
 +{
 +    /* hash functions must be initialized before setContext() is called */
 +    if (hash_secret_salt == 0)
 +      hash_secret_salt = generate_hash_secret_salt();
-+    if (parser != NULL && ns) {
++    if (ns) {
 +      /* implicit context only set for root parser, since child
 +         parsers (i.e. external entity parsers) will inherit it
 +      */
@@ -68,7 +68,7 @@
    case XML_INITIALIZED:
 -    if (hash_secret_salt == 0)
 -      hash_secret_salt = generate_hash_secret_salt();
-+    if (!parsingSetup(parser)) {
++    if (parentParser == NULL && !startParsing(parser)) {
 +      errorCode = XML_ERROR_NO_MEMORY;
 +      return XML_STATUS_ERROR;
 +    }
@@ -81,7 +81,7 @@
    case XML_INITIALIZED:
 -    if (hash_secret_salt == 0)
 -      hash_secret_salt = generate_hash_secret_salt();
-+    if (!parsingSetup(parser)) {
++    if (parentParser == NULL && !startParsing(parser)) {
 +      errorCode = XML_ERROR_NO_MEMORY;
 +      return XML_STATUS_ERROR;
 +    }






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in dev-libs/expat/files: expat-2.1.0_beta2-move_setContext_call.patch
@ 2012-03-15  2:30 Samuli Suominen (ssuominen)
  0 siblings, 0 replies; 3+ messages in thread
From: Samuli Suominen (ssuominen) @ 2012-03-15  2:30 UTC (permalink / raw
  To: gentoo-commits

ssuominen    12/03/15 02:30:28

  Removed:              expat-2.1.0_beta2-move_setContext_call.patch
  Log:
  old
  
  (Portage version: 2.2.0_alpha90/cvs/Linux x86_64)



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-15  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15  2:30 [gentoo-commits] gentoo-x86 commit in dev-libs/expat/files: expat-2.1.0_beta2-move_setContext_call.patch Samuli Suominen (ssuominen)
  -- strict thread matches above, loose matches on Subject: below --
2012-03-11  9:56 Samuli Suominen (ssuominen)
2012-03-10 17:51 Samuli Suominen (ssuominen)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox