Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 577
    • Issues 577
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 111
    • Merge requests 111
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • BINDBIND
  • Issues
  • #1214
Closed
Open
Issue created Sep 05, 2019 by Ghost User@ghost

Potential for NULL pointer de-reference (CWE-476) in file 'dnssec-keyfromlabel.c'

Summary

In reviewing calls to 'isc_mem_strdup()', in directory '/bin/dnssec' file 'dnssec-keyfromlabel.c' at line 221, there is a call made to 'isc_mem_strdup()' that is not checked for a return value of NULL, which potentially could cause a NULL pointer dereference

BIND version used

9.14.5

Steps to reproduce

Bug is in software

What is the current bug behavior?

If memory allocation fails, the end result could be a 'segmentation fault (core dumped)', the check added prevents this by a graceful exit...

What is the expected correct behavior?

All memory allocations should be checked to ensure the memory requested is actually returned.

Relevant configuration files

N/A

Relevant logs and/or screenshots

N/A

Possible fixes

Attaching patch file to this bug report...dnssec-keyfromlabel.c.patch

--- dnssec-keyfromlabel.c.orig  2019-09-04 19:09:14.010784200 -0700
+++ dnssec-keyfromlabel.c       2019-09-04 19:11:05.835919500 -0700
@@ -221,6 +221,8 @@
                        break;
                case 'l':
                        label = isc_mem_strdup(mctx, isc_commandline_argument);
+                       if (label == NULL)
+                           fatal("out of memory");
                        break;
                case 'n':
                        nametype = isc_commandline_argument;
Assignee
Assign to
Time tracking