WILDWEEGEE / test_repo

Testing first GitHub app
0 stars 3 forks source link

testing html #41

Open WILDWEEGEE opened 6 years ago

WILDWEEGEE commented 6 years ago

This is a header

WILDWEEGEE commented 6 years ago

<!doctype html>

simple.c

Bug Summary

File:C:\Users\Gianluca\Documents\CIS 400\GARBAGE/simple.c
Warning:line 12, column 32
Dereference of null pointer (loaded from variable 'p')

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -triple x86_64-pc-windows-msvc19.15.26732 -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name simple.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix.API -analyzer-checker=unix.Malloc -analyzer-checker=unix.MallocSizeof -analyzer-checker=unix.MismatchedDeallocator -analyzer-checker=unix.cstring.BadSizeArg -analyzer-checker=unix.cstring.NullArg -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -resource-dir C:\Program Files\LLVM\lib\clang\7.0.0 -internal-isystem C:\Program Files\LLVM\lib\clang\7.0.0\include -internal-isystem C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include -internal-isystem C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt -fdebug-compilation-dir C:\Users\Gianluca\Documents\CIS 400\GARBAGE -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.15.26732 -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -analyzer-output=html -o C:\Users\Gianluca\AppData\Local\Temp/scan-build-2018-11-08-021239-14308-1 -x c simple.c
1#include <stdio.h>
2#include <string.h>
3
4int main(int argc, char* argv[]) {
5 int x = 23;
6 int* p = &x;
7
8 if (argc >= 2 && strcmp(argv[1], "kek") == 0) {
1
Assuming 'argc' is >= 2
2
Taking true branch
9 p = NULL((void *)0);
3
Null pointer value stored to 'p'
10 }
11
12 printf("The number is %d", *p);
4
Dereference of null pointer (loaded from variable 'p')
13
14 int* z = NULL((void *)0);
15
16 x += *z;
17
18 int arr[10];
19 arr[0] = 2;
20 int y = 11;
21 p = &y;
22 arr[*p] = 11;
23
24 return 0;
25}
WILDWEEGEE commented 6 years ago

<!DOCTYPE html>

test.c

Bug Summary

File:test.c
Location:line 33, column 32
Description:Dereference of null pointer (loaded from variable 'p2')

Annotated Source Code

1#include <stdio.h>
2#include <string.h>
3#include "helper.h"
4
5int otherHelper(int* p) {
6 return *p - 5;
7}
8
9// Dereference pointer without checking if NULL
10int helper2(int* p) {
11 printf("wow\n");
12 return *p + 4;
13}
14
15int main(int argc, char* argv[]) {
16 int num1 = 15;
17 int num2 = 20;
18
19 int* p1 = &num1;
20 int* p2 = &num2;
21
22 if (argc >= 2 && strcmp(argv[1], "wow") == 0) {
1
Assuming 'argc' is >= 2
2
Taking false branch
23 p1 = NULL((void*)0);
24 }
25
26 if (argc >= 2 && strcmp(argv[1], "test") == 0) {
3
Taking true branch
27 p2 = NULL((void*)0);
4
Null pointer value stored to 'p2'
28 }
29
30 printf("amazing\n");
31
32 printf("num1 + 4 is %d\n", helper2(p1));
33 printf("num2 - 5 is %d\n", *p2);
5
Dereference of null pointer (loaded from variable 'p2')
34
35 int* p3 = NULL((void*)0);
36
37 return *p3;
38}
WILDWEEGEE commented 6 years ago

<!DOCTYPE html>

Bug Summary

File:test.c
Location:line 33, column 32
Description:Dereference of null pointer (loaded from variable 'p2')

Annotated Source Code

1#include <stdio.h>
2#include <string.h>
3#include "helper.h"
4
5int otherHelper(int* p) {
6 return *p - 5;
7}
8
9// Dereference pointer without checking if NULL
10int helper2(int* p) {
11 printf("wow\n");
12 return *p + 4;
13}
14
15int main(int argc, char* argv[]) {
16 int num1 = 15;
17 int num2 = 20;
18
19 int* p1 = &num1;
20 int* p2 = &num2;
21
22 if (argc >= 2 && strcmp(argv[1], "wow") == 0) {
1
Assuming 'argc' is >= 2
2
Taking false branch
23 p1 = NULL((void*)0);
24 }
25
26 if (argc >= 2 && strcmp(argv[1], "test") == 0) {
3
Taking true branch
27 p2 = NULL((void*)0);
4
Null pointer value stored to 'p2'
28 }
29
30 printf("amazing\n");
31
32 printf("num1 + 4 is %d\n", helper2(p1));
33 printf("num2 - 5 is %d\n", *p2);
5
Dereference of null pointer (loaded from variable 'p2')
34
35 int* p3 = NULL((void*)0);
36
37 return *p3;
38}