Mesa (master): glsl: initialise pointer to NULL

Iago Toral Quiroga itoral at kemper.freedesktop.org
Tue Jun 7 06:13:55 UTC 2016


Module: Mesa
Branch: master
Commit: b450f29073c4129896fce37699ef3d7f152ed458
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b450f29073c4129896fce37699ef3d7f152ed458

Author: Jakob Sinclair <sinclair.jakob at openmailbox.org>
Date:   Sat Jun  4 01:09:52 2016 +0200

glsl: initialise pointer to NULL

Could cause issues if you tried to read from an uninitialised pointer.
This just initalises the pointer to null to avoid that being a problem.
Discovered by Coverity.

CID: 1343616

Signed-off-by: Jakob Sinclair <sinclair.jakob at openmailbox.org>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

---

 src/compiler/glsl/glsl_parser_extras.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index fde8c19..09f7477 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1603,6 +1603,7 @@ ast_struct_specifier::ast_struct_specifier(const char *identifier,
    name = identifier;
    this->declarations.push_degenerate_list_at_head(&declarator_list->link);
    is_declaration = true;
+   layout = NULL;
 }
 
 void ast_subroutine_list::print(void) const




More information about the mesa-commit mailing list