Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

Branching Factor Capability#1

Open
niroshan wants to merge 1 commit into
mainfrom
branching-factor-patch
Open

Branching Factor Capability#1
niroshan wants to merge 1 commit into
mainfrom
branching-factor-patch

Conversation

@niroshan
Copy link
Copy Markdown

@niroshan niroshan commented Mar 9, 2023

Demonstration of introducing a software bug for our static analysis demonstration for CodeQL

Demonstration of introducing a software bug for our static analysis demonstration for CodeQL
Comment thread hello/main.c
*/
// This line can allocate too little memory if factor
// is very large.
char **root_node = (char **) malloc(factor * sizeof(char *));

Check failure

Code scanning / CodeQL

Overflow in uncontrolled allocation size

This allocation size is derived from [user input (an environment variable)](1) and might overflow.
Comment thread hello/main.c
Comment on lines +39 to +43
/*if (factor < 0 || factor > 1000) {
log("Factor out of range (%d)\n", factor);
return -1;
}
*/

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
Comment thread hello/main.c
*/
// This line can allocate too little memory if factor
// is very large.
char **root_node = (char **) malloc(factor * sizeof(char *));

Check notice

Code scanning / CodeQL

Unused local variable

Variable root_node is not used.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants