Re: [XXE] Bug: Crash when RegEx for AnyCharacter and HTML is empty</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=xmleditor-support@xmlmind.com&q=from:%22Hussein+Shafie%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Hussein Shafie</span></span></a></span> <span class="date"><a href="/search?l=xmleditor-support@xmlmind.com&q=date:20241127" rel="nofollow">Wed, 27 Nov 2024 07:16:31 -0800</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre style="margin: 0em;"> On 11/24/24 17:29, Leif H Silli wrote: </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><tt>(I have gotten the same result twice, for the same HTML document. But I </tt><tt>did not look deeply to understand the reason/cause of this bug.) </tt><pre style="margin: 0em;"></pre><pre> 1) What I did: </pre><tt>I was thinking to myself about proposing that XXE should get a Word & </tt><tt>Character count tool. But then I figured I should just use XXE’s RegEx, </tt><tt>for the time being. </tt><pre style="margin: 0em;"> </pre><tt>However, in my HTML document, I did not want to count the content of the </tt><tt><title> element. But how to avoid that? </tt><pre style="margin: 0em;"> I ended up deleting the content of <title> - which thus became empty. </pre><tt>And then I placed the cursor inside <title> (since that was the topmost </tt><tt>element in my simple document). </tt><pre style="margin: 0em;"> 2) Expected outcome: </pre><tt>I would search for AnyCharacter (using the dott in a RegEx search) in </tt><tt>the document, replacing the each finding with $0. I would then get, as </tt><tt>«side effect» the numer of replacements displayed at the bottom of the </tt><tt>Window in XXE. </tt><pre style="margin: 0em;"> 3) Actual result: </pre><tt>The above expectation did work, as long as <title> was non-empty. But </tt><tt>when <title> was empty (and the cursor as well – and logically - was </tt><tt>placed inside <title>), XXE would start to crash. (The crashing took for </tt><tt>ever, so it would perhaps be more accurate to describe it as a freeze.) </tt><pre style="margin: 0em;"> 4) Workaround: Make sure that <title> is not empty. </pre><tt>Btw, I wonder if the same thing would happen for any empty element that </tt><tt>is supposed to be able to contain textual content. However, I did not </tt><tt>run any tests to check/verify that assumption. </tt><pre style="margin: 0em;"> </pre></blockquote><tt>Thank you for taking the time to report that bug. We'll try to reproduce </tt><tt>it and fix it in next version of XXE. </tt><pre style="margin: 0em;"> -- XMLmind XML Editor Support List xmleditor-support@xmlmind.com <a rel="nofollow" href="http://www.xmlmind.com/mailman/listinfo/xmleditor-support">http://www.xmlmind.com/mailman/listinfo/xmleditor-support</a> </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg12485.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="index.html#12496">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="maillist.html#12496">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg12486.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email"><span class="subject"><a href="msg12485.html">[XXE] Bug: Crash when RegEx for AnyCharacter and HTML <t...</a></span> <span class="sender italic">Leif H Silli</span></li> <li><ul> <li class="icons-email tSliceCur"><span class="subject">Re: [XXE] Bug: Crash when RegEx for AnyCharacter and H...</span> <span class="sender italic">Hussein Shafie</span></li> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="Re: [XXE] Bug: Crash when RegEx for AnyCharacter and HTML <title> is empty"> <input type="hidden" name="msgid" value="cdbec6e6-f4d4-4a7c-bf97-6ec544543b0e@xmlmind.com"> <input type="hidden" name="relpath" value="xmleditor-support@xmlmind.com/msg12496.html"> <input type="submit" value=" Hussein Shafie "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="xmleditor-support@xmlmind.com"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search xmleditor-support"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/xmleditor-support@xmlmind.com/">xmleditor-support - all messages</a></li> <li class="icons-about"><a href="/xmleditor-support@xmlmind.com/info.html">xmleditor-support - about the list</a></li> <li class="icons-expand"><a href="/search?l=xmleditor-support@xmlmind.com&q=subject:%22Re%5C%3A+%5C%5BXXE%5C%5D+Bug%5C%3A+Crash+when+RegEx+for+AnyCharacter+and+HTML+%3Ctitle%3E+is+empty%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg12485.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg12486.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> <a href="#"><img src="/xmleditor-support@xmlmind.com/logo.png" alt="xmleditor-support"></a> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">cdbec6e6-f4d4-4a7c-bf97-6ec544543b0e@xmlmind.com</li> </ul> </div> </body> </html>