Browse Source

Bug 630091 - (cov#12209) Use of uninitialized pointer in libaccess

It looks like aclpvt is only initialized before use if __cplusplus
or lint are defined.  I see no harm in always initializing aclpvt
to NULL, which will guarantee that we don't use an uninitialized
pointer.
Nathan Kinder 15 years ago
parent
commit
8f1cdb3193
1 changed files with 1 additions and 2 deletions
  1. 1 2
      lib/libaccess/acl.tab.cpp

+ 1 - 2
lib/libaccess/acl.tab.cpp

@@ -724,7 +724,7 @@ int acl_Parse(void)
 int acl_Parse()
 int acl_Parse()
 #endif
 #endif
 {
 {
-	register ACLSTYPE *aclpvt;	/* top of value stack for $vars */
+	register ACLSTYPE *aclpvt = 0;	/* top of value stack for $vars */
 
 
 #if defined(__cplusplus) || defined(lint)
 #if defined(__cplusplus) || defined(lint)
 /*
 /*
@@ -737,7 +737,6 @@ int acl_Parse()
 		case 1: goto aclerrlab;
 		case 1: goto aclerrlab;
 		case 2: goto aclnewstate;
 		case 2: goto aclnewstate;
 	}
 	}
-	aclpvt = 0;
 #endif
 #endif
 
 
 	/*
 	/*