mIRC Homepage

Comval call crash

Posted By: kap

Comval call crash - 19/04/20 03:40 PM


I can reliably and consistently crash mIRC (mIRC instantly exits) with the following code:

/crashesin761 https://forums.mirc.com/ubbthreads.php/activetopics/1/1

; example web: Active threads past 24 hours:
; example url: https://forums.mirc.com/ubbthreads.php/activetopics/1/1 

alias crashesin761 {
  var %url $1, %error
  var %t $ticks, %com mforum. $+ %t, %com2 mforum2. $+ %t, %com3 mforum3. $+ %t

  .comopen %com MSXML2.SERVERXMLHttp.6.0
  if ((!$com(%com)) || ($comerr)) %error = Unable to create an instance of MSXML2.SERVERXMLHttp.6.0
  elseif ((!$com(%com, open, 1, bstr, GET, bstr, %url, bool, false)) || ($comerr)) %error = Unable to initialise the request
  elseif ((!$com(%com, send, 1)) || ($comerr)) %error = Request failed
  else {
    if ((!$com(%com, responseText, 2)) || ($comerr)) %error = Failed to retrieve response text
    elseif ((!$com(%com, &responseText).result) || ($comerr)) %error = Failed to place result into binvar
    else {
      .comopen %com2 HTMLFile
      echo -a OK1
      if ((!$com(%com2)) || ($comerr)) %error = Unable to create an instance of HTMLFile
      elseif ((!$com(%com2, write, 3, &bstr, &responseText)) || ($comerr)) %error = Cannot pour binvar into HTMLFile object
      elseif ((!$com(%com2, queryselectorall, 3, bstr, table, dispatch* %com3)) || ($comerr)) %error = Hello
      else {
        if ($com(%com3)) {
          var -s %item 0, %items $comval(%com3,0)

  ; Handle errors
  if ($error) %error = $v1 | reseterror

  ; Close coms
  if ($com(%com)) .comclose %com
  if ($com(%com2)) .comclose %com2
  if ($com(%com3)) .comclose %com3

  ; Show error
  if (%error) echo -ag $v1


- mIRC reports no error
- If I use the latest beta, same thing happens.
- If I wrap table in double quote marks, no crash happens, i.e.:

  elseif ((!$com(%com2, queryselectorall, 3, bstr, "table", dispatch* %com3)) || ($comerr)) %error = Hello

Posted By: Khaled

Re: Comval call crash - 22/04/20 05:44 PM

Thanks for your bug report. I was able to reproduce this. I have made a change that should resolve this in the next beta.
© 2020 mIRC Discussion Forums