Menu ▾ ▴

#175 Return value of mysql_library_init

7.2-beta
closed
None
2016-09-28
2016-09-20
WhiteWind
No

Return value of mysql_library_init/mysql_server_init is not checked.
However, if this function returns error, then calls to any mysql functions produce undefinded result (Access Violations)
https://sourceforge.net/p/zeoslib/code-0/HEAD/tree/tags/7.2.1-rc/src/plain/ZPlainMySqlDriver.pas#l975

Discussion

  • marsupilami79

    marsupilami79 - 2016-09-22

    That is changed with the latest revision in the SVN. Do you agree?

    Best regards,

    Jan

     
    • WhiteWind

      WhiteWind - 2016-09-22
       
      • marsupilami79

        marsupilami79 - 2016-09-25

        My changes were done in the testing-7.2 branch. See https://sourceforge.net/p/zeoslib/code-0/HEAD/tree/branches/testing-7.2/src/plain/ZPlainMySqlDriver.pas#l980
        Checking the result of mysql_init might be a good idea nontheless - although it only should reserve some meomory and returning a null pointer means that no memory could be aquired...

         

        Last edit: marsupilami79 2016-09-25
        • WhiteWind

          WhiteWind - 2016-09-25

          Now I see.
          mysql_init result should be checked too, you can't call any mysql func with null mysql handle

           
          • marsupilami79

            marsupilami79 - 2016-09-27

            Changed in SVN Rev. 3934 for Zeos 7.2 testing branch. Do you agree? In that case I will close this bug as fixed. :o)

             
            • WhiteWind

              WhiteWind - 2016-09-28

              Yes, you can close this bug

               
  • marsupilami79

    marsupilami79 - 2016-09-28
    • status: open --> closed
    • assigned_to: marsupilami79
    • Milestone: Unknown --> 7.2-beta
     

Log in to post a comment.