Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-38696

my_copy() can cause infinite loop

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 11.8
    • 10.11, 11.4, 11.8, 12.3
    • None
    • None

    Description

      Take a look at the following code in my_copy():

         while ((Count=my_read(from_file, buff, sizeof(buff), MyFlags)) != 0)        
          {                                                                           
              if (Count == (uint) -1 ||                                             
                  my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP)))                
              goto err;                                                               
          } 
      

      That (uint) is wrong, because Count is of size_t type. That causes infinite loop. The code is checked in 11.8, but I am quite sure it exists in earlier versions.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            vlad.lesin Vladislav Lesin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.