Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-292

Erroneous malloc() result check in mariadb_dyncol_val_double()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.2
    • 3.0.3
    • None
    • None

    Description

      mariadb_dyncol_val_double() function (defined in libmariadb/mariadb_dyncol.c) has the following code:

        if ((str= malloc(val->x.string.value.length + 1)))
          return ER_DYNCOL_RESOURCE;
        memcpy(str, val->x.string.value.str, val->x.string.value.length);
      

      Shouldn't it be

        if ((str= malloc(val->x.string.value.length + 1)) == NULL)
        ...
      

      instead?

      Attachments

        Activity

          People

            georg Georg Richter
            karen Karen Arutyunov
            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.