mIRC Home    About    Download    Register    News    Help

Print Thread
Comval call crash #267200 19/04/20 03:40 PM
Joined: Feb 2015
Posts: 105
kap Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Feb 2015
Posts: 105
Hi,

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

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


Code
; 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
  :error
  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
}


Remarks:

- 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.:

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



GNU Terry Pratchett
Re: Comval call crash [Re: kap] #267210 22/04/20 05:44 PM
Joined: Dec 2002
Posts: 4,792
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,792
Thanks for your bug report. I was able to reproduce this. I have made a change that should resolve this in the next beta.