[PATCH] wml compiler panics on some wml files

Vjacheslav Chekushin <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization LMT
Message-ID <[email protected]>
Hi, list.

wml_compiler PANIC on wml files with some DOCTYPE definition.
(PANIC: gwlib/octstr.c:242: octstr_create_real: Assertion `cstr != NULL' failed.)
One example is below. You can check with wml file
with wml_tester. Attached patch fixes this problem.

<?xml version='1.0'?>
<!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [
<!ENTITY plainEntity "FOO entity">]>
<wml>
    <card id="main" name="Test">
          <img src="/img/logo.wbmp" alt="image"/>
             <p>
              <a href="1.php">1</a><br/>
              <a href="2.php">2</a><br/>
              <a href="3.php">3</a><br/>
              <a href="4.php">4</a><br/>
            </p>
    </card>
</wml>

-- 
Vjacheslav Chekushin                                mailto:[email protected]
Latvian Mobile Phone Company                        http://www.lmt.lv
wml_comp_panic.patch (text/plain, 500 B)
--- ../gateway-1.3.2_base/gw/wml_compiler.c	Wed Apr 21 13:45:35 2004
+++ gw/wml_compiler.c	Mon Aug  9 14:51:54 2004
@@ -597,7 +597,7 @@
     }
 
     /* Return WML Version dependent on xml ExternalID string */
-    if (document->intSubset != NULL)
+    if ((document->intSubset != NULL) && (document->intSubset->ExternalID != NULL))
         externalID = octstr_create(document->intSubset->ExternalID);
     if (externalID == NULL) {
         (*wbxml)->wml_public_id = 0x04; /* WML 1.1 Public ID */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.