• client/server crash when trying to process template with access < Manager

    By Ninke Westra 2 decades ago

    Crash occurs in setReplicaInfo function in the WeeWillieWinkie.BE script lib.



    After setting the replicainfo block the dbhandle is closed:


        retflg = W32_NSFDbReplicaInfoSet(hdb, replicaInfo)<br/>
        If retflg &lt;&gt; 0 Then Error retflg, &quot;Error setting replica info from the API. Aborting...&quot;<br/>
        <br/>
        If hdb &lt;&gt; 0 Then retflg = W32_NSFDbClose(hdb)<br/>
    

    '–> add this: hdb=0 ' reset to zero to avoid closing it again if an error occurs later on in this sub



    After this, the code uses the db.replicationinfo property to enable/disable replication, if an error occurs in this section, the error handler will try to free the same dbhandle (hdb) :


    If hdb &lt;&gt; 0 Then retflg = W32_NSFDbClose(hdb) <br/>
    



    By adding 'hdb=0 after freeing the dbhandle in the first section, an error triggered after closing the c-api dbhandle the error handler will not try to close it yet again, which will trigger a crash.



    Cheers



    IRC: Woonjas on EFNet's #notes