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

NULL pointer dereference in partition_info::set_partition_bitmaps_from_table

Details

    Description

      sql/partition_info.cc

      bool partition_info::set_partition_bitmaps_from_table(TABLE_LIST *table_list)
      {
        List<String> *partition_names= table_list ?
                                         NULL : table_list->partition_names;
        return set_partition_bitmaps(partition_names);
      }
      

      If table_list is not NULL then we assign NULL to partition_names.
      If table_list is NULL then we dereference NULL pointer in table_list->partition_names.

      Looks like the order of the ? operator results should be reversed:

      bool partition_info::set_partition_bitmaps_from_table(TABLE_LIST *table_list)
      {
        List<String> *partition_names= table_list ?
                                         table_list->partition_names : NULL;
        return set_partition_bitmaps(partition_names);
      }
      

      Attachments

        Activity

          yury.chaikou Yury Chaikou created issue -
          yury.chaikou Yury Chaikou made changes -
          Field Original Value New Value
          Affects Version/s 10.3.5 [ 22905 ]
          yury.chaikou Yury Chaikou added a comment - Introduced in 10.3.5 - https://github.com/MariaDB/server/commit/b4a2baffa82e5c07b96a1c752228560dcac1359b
          yury.chaikou Yury Chaikou made changes -
          Description sql/partition_info.cc
          {code:c++}
          bool partition_info::set_partition_bitmaps_from_table(TABLE_LIST *table_list)
          {
            List<String> *partition_names= table_list ?
                                             NULL : table_list->partition_names;
            return set_partition_bitmaps(partition_names);
          }
          {code}

          If table_list is not NULL then we assign NULL to partition_names.
          If table_list is NULL then we dereference NULL pointer in table_list->partition_names.

          Looks like the order of the ? operator results should be reverted:
          {code:c++}
          bool partition_info::set_partition_bitmaps_from_table(TABLE_LIST *table_list)
          {
            List<String> *partition_names= table_list ?
                                             table_list->partition_names : NULL;
            return set_partition_bitmaps(partition_names);
          }
          {code}
          sql/partition_info.cc
          {code:c++}
          bool partition_info::set_partition_bitmaps_from_table(TABLE_LIST *table_list)
          {
            List<String> *partition_names= table_list ?
                                             NULL : table_list->partition_names;
            return set_partition_bitmaps(partition_names);
          }
          {code}

          If table_list is not NULL then we assign NULL to partition_names.
          If table_list is NULL then we dereference NULL pointer in table_list->partition_names.

          Looks like the order of the ? operator results should be reversed:
          {code:c++}
          bool partition_info::set_partition_bitmaps_from_table(TABLE_LIST *table_list)
          {
            List<String> *partition_names= table_list ?
                                             table_list->partition_names : NULL;
            return set_partition_bitmaps(partition_names);
          }
          {code}
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Fix Version/s 10.6 [ 24028 ]
          Fix Version/s 10.7 [ 24805 ]
          Fix Version/s 10.8 [ 26121 ]
          Fix Version/s 10.9 [ 26905 ]
          Fix Version/s 10.10 [ 27530 ]
          serg Sergei Golubchik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Status In Progress [ 3 ] In Testing [ 10301 ]
          serg Sergei Golubchik made changes -
          Component/s OTHER [ 10125 ]
          Fix Version/s 10.3.38 [ 28507 ]
          Fix Version/s 10.4.28 [ 28509 ]
          Fix Version/s 10.5.19 [ 28511 ]
          Fix Version/s 10.6.12 [ 28513 ]
          Fix Version/s 10.7.8 [ 28515 ]
          Fix Version/s 10.8.7 [ 28517 ]
          Fix Version/s 10.9.5 [ 28519 ]
          Fix Version/s 10.10.3 [ 28521 ]
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Fix Version/s 10.6 [ 24028 ]
          Fix Version/s 10.7 [ 24805 ]
          Fix Version/s 10.8 [ 26121 ]
          Fix Version/s 10.9 [ 26905 ]
          Fix Version/s 10.10 [ 27530 ]
          Resolution Fixed [ 1 ]
          Status In Testing [ 10301 ] Closed [ 6 ]

          People

            serg Sergei Golubchik
            yury.chaikou Yury Chaikou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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