libvncserver-0.9.15-3.fc43

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:454:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:438:12: branch_false: following ‘false’ branch (when ‘c’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:441:38: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:441:38: acquire_memory: allocated here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:442:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:446:38: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:447:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:453:11: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:453:11: branch_true: following ‘true’ branch (when ‘credentialType != 2’)...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:454:13: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:454:13: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  452|   
#  453|   	if(credentialType != rfbCredentialTypeUser) {
#  454|-> 	    rfbClientErr("something else than username and password required for authentication\n");
#  455|   	    return NULL;
#  456|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:454:13: warning[-Wanalyzer-malloc-leak]: leak of ‘c’
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:437:28: acquire_memory: allocated here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:438:12: branch_false: following ‘false’ branch (when ‘c’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:441:38: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:442:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:446:38: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:447:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:453:11: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:453:11: branch_true: following ‘true’ branch (when ‘credentialType != 2’)...
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:454:13: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:454:13: danger: ‘c’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  452|   
#  453|   	if(credentialType != rfbCredentialTypeUser) {
#  454|-> 	    rfbClientErr("something else than username and password required for authentication\n");
#  455|   	    return NULL;
#  456|   	}

Error: CPPCHECK_WARNING (CWE-401): [#def3]
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:455: error[memleak]: Memory leak: c
#  453|   	if(credentialType != rfbCredentialTypeUser) {
#  454|   	    rfbClientErr("something else than username and password required for authentication\n");
#  455|-> 	    return NULL;
#  456|   	}
#  457|   

Error: CPPCHECK_WARNING (CWE-401): [#def4]
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:455: error[memleak]: Memory leak: c.userCredential
#  453|   	if(credentialType != rfbCredentialTypeUser) {
#  454|   	    rfbClientErr("something else than username and password required for authentication\n");
#  455|-> 	    return NULL;
#  456|   	}
#  457|   

Error: COMPILER_WARNING (CWE-252): [#def5]
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c: scope_hint: In function ‘get_credential’
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:460:9: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#  460 |         fgets(c->userCredential.username, RFB_BUF_SIZE, stdin);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  458|   	rfbClientLog("username and password required for authentication!\n");
#  459|   	printf("user: ");
#  460|-> 	fgets(c->userCredential.username, RFB_BUF_SIZE, stdin);
#  461|   	printf("pass: ");
#  462|   	fgets(c->userCredential.password, RFB_BUF_SIZE, stdin);

Error: COMPILER_WARNING (CWE-252): [#def6]
libvncserver-LibVNCServer-0.9.15/examples/client/SDLvncviewer.c:462:9: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#  462 |         fgets(c->userCredential.password, RFB_BUF_SIZE, stdin);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  460|   	fgets(c->userCredential.username, RFB_BUF_SIZE, stdin);
#  461|   	printf("pass: ");
#  462|-> 	fgets(c->userCredential.password, RFB_BUF_SIZE, stdin);
#  463|   
#  464|   	/* remove trailing newlines */

Error: COMPILER_WARNING (CWE-563): [#def7]
libvncserver-LibVNCServer-0.9.15/examples/client/vnc2mpg.c:67:9: warning[-Wunused-variable]: unused variable ‘i’
#   67 |     int i;
#      |         ^
#   65|                          enum AVCodecID codec_id, int64_t br, int sr, int w, int h)
#   66|   {
#   67|->     int i;
#   68|   
#   69|       /* find the encoder */

Error: COMPILER_WARNING (CWE-704): [#def8]
libvncserver-LibVNCServer-0.9.15/examples/client/vnc2mpg.c: scope_hint: In function ‘add_video_stream’
libvncserver-LibVNCServer-0.9.15/examples/client/vnc2mpg.c:70:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   70 |     ost->codec = avcodec_find_encoder(codec_id);
#      |                ^
#   68|   
#   69|       /* find the encoder */
#   70|->     ost->codec = avcodec_find_encoder(codec_id);
#   71|       if (!(ost->codec)) {
#   72|           fprintf(stderr, "Could not find encoder for '%s'\n",

Error: COMPILER_WARNING (CWE-704): [#def9]
libvncserver-LibVNCServer-0.9.15/examples/client/vnc2mpg.c:70:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   68|   
#   69|       /* find the encoder */
#   70|->     ost->codec = avcodec_find_encoder(codec_id);
#   71|       if (!(ost->codec)) {
#   72|           fprintf(stderr, "Could not find encoder for '%s'\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def10]
libvncserver-LibVNCServer-0.9.15/examples/server/cursors.c:37:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buffer’
libvncserver-LibVNCServer-0.9.15/examples/server/cursors.c:329:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/examples/server/cursors.c:332:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/examples/server/cursors.c:335:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/examples/server/cursors.c:336:41: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/examples/server/cursors.c:339:9: call_function: calling ‘initBuffer’ from ‘main’
#   35|   	for(j=0;j<maxy;++j) {
#   36|   		for(i=0;i<maxx;++i) {
#   37|-> 			buffer[(j*maxx+i)*bpp+0]=(i+j)*128/(maxx+maxy); /* red */
#   38|   			buffer[(j*maxx+i)*bpp+1]=i*128/maxx; /* green */
#   39|   			buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */

Error: CPPCHECK_WARNING (CWE-476): [#def11]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:54: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   52|     for(j=0;j<maxy;++j) {
#   53|       for(i=0;i<maxx;++i) {
#   54|->       buffer[(j*maxx+i)*bpp+0]=(i+j)*128/(maxx+maxy); /* red */
#   55|         buffer[(j*maxx+i)*bpp+1]=i*128/maxx; /* green */
#   56|         buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:54:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buffer’
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:87:13: enter_function: entry to ‘newframebuffer’
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:94:27: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:95:3: call_function: calling ‘initBuffer’ from ‘newframebuffer’
#   52|     for(j=0;j<maxy;++j) {
#   53|       for(i=0;i<maxx;++i) {
#   54|->       buffer[(j*maxx+i)*bpp+0]=(i+j)*128/(maxx+maxy); /* red */
#   55|         buffer[(j*maxx+i)*bpp+1]=i*128/maxx; /* green */
#   56|         buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */

Error: CPPCHECK_WARNING (CWE-476): [#def13]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:55: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   53|       for(i=0;i<maxx;++i) {
#   54|         buffer[(j*maxx+i)*bpp+0]=(i+j)*128/(maxx+maxy); /* red */
#   55|->       buffer[(j*maxx+i)*bpp+1]=i*128/maxx; /* green */
#   56|         buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */
#   57|       }

Error: CPPCHECK_WARNING (CWE-476): [#def14]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:56: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   54|         buffer[(j*maxx+i)*bpp+0]=(i+j)*128/(maxx+maxy); /* red */
#   55|         buffer[(j*maxx+i)*bpp+1]=i*128/maxx; /* green */
#   56|->       buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */
#   57|       }
#   58|       buffer[j*maxx*bpp+0]=0xff;

Error: CPPCHECK_WARNING (CWE-476): [#def15]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:58: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   56|         buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */
#   57|       }
#   58|->     buffer[j*maxx*bpp+0]=0xff;
#   59|       buffer[j*maxx*bpp+1]=0xff;
#   60|       buffer[j*maxx*bpp+2]=0xff;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:58:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buffer’
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:87:13: enter_function: entry to ‘newframebuffer’
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:94:27: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:95:3: call_function: calling ‘initBuffer’ from ‘newframebuffer’
#   56|         buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */
#   57|       }
#   58|->     buffer[j*maxx*bpp+0]=0xff;
#   59|       buffer[j*maxx*bpp+1]=0xff;
#   60|       buffer[j*maxx*bpp+2]=0xff;

Error: CPPCHECK_WARNING (CWE-476): [#def17]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:59: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   57|       }
#   58|       buffer[j*maxx*bpp+0]=0xff;
#   59|->     buffer[j*maxx*bpp+1]=0xff;
#   60|       buffer[j*maxx*bpp+2]=0xff;
#   61|       buffer[j*maxx*bpp+3]=0xff;

Error: CPPCHECK_WARNING (CWE-476): [#def18]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:60: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   58|       buffer[j*maxx*bpp+0]=0xff;
#   59|       buffer[j*maxx*bpp+1]=0xff;
#   60|->     buffer[j*maxx*bpp+2]=0xff;
#   61|       buffer[j*maxx*bpp+3]=0xff;
#   62|     }

Error: CPPCHECK_WARNING (CWE-476): [#def19]
libvncserver-LibVNCServer-0.9.15/examples/server/example.c:61: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   59|       buffer[j*maxx*bpp+1]=0xff;
#   60|       buffer[j*maxx*bpp+2]=0xff;
#   61|->     buffer[j*maxx*bpp+3]=0xff;
#   62|     }
#   63|   }

Error: COMPILER_WARNING (CWE-252): [#def20]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow.c: scope_hint: In function ‘main’
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow.c:33:3: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#   33 |   fgets(buffer,1024,in);
#      |   ^~~~~~~~~~~~~~~~~~~~~
#   31|     }
#   32|   
#   33|->   fgets(buffer,1024,in);
#   34|     if(!strncmp(buffer,"P6",2)) {
#   35|   	  picType=TRUECOLOUR;

Error: COMPILER_WARNING (CWE-252): [#def21]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow.c:50:5: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#   50 |     fgets(buffer,1024,in);
#      |     ^~~~~~~~~~~~~~~~~~~~~
#   48|     /* skip comments */
#   49|     do {
#   50|->     fgets(buffer,1024,in);
#   51|     } while(buffer[0]=='#');
#   52|   

Error: COMPILER_WARNING (CWE-252): [#def22]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow.c:60:9: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#   60 |         fgets(buffer,1024,in);
#      |         ^~~~~~~~~~~~~~~~~~~~~
#   58|     rfbLog("Got width %d and height %d.\n",width,height);
#   59|     if(picType!=BW)
#   60|-> 	fgets(buffer,1024,in);
#   61|     else
#   62|   	  width=1+((width-1)|7);

Error: COMPILER_WARNING (CWE-252): [#def23]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow.c:93:3: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’
#   93 |   fread(rfbScreen->frameBuffer,width*bitsPerPixelInFile/8,height,in);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   91|     if(!rfbScreen->frameBuffer)
#   92|         exit(1);
#   93|->   fread(rfbScreen->frameBuffer,width*bitsPerPixelInFile/8,height,in);
#   94|     fclose(in);
#   95|   

Error: COMPILER_WARNING (CWE-252): [#def24]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow24.c: scope_hint: In function ‘main’
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow24.c:41:3: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#   41 |   fgets(buffer,1024,in);
#      |   ^~~~~~~~~~~~~~~~~~~~~
#   39|     }
#   40|   
#   41|->   fgets(buffer,1024,in);
#   42|     if(strncmp(buffer,"P6",2)) {
#   43|       printf("Not a ppm.\n");

Error: COMPILER_WARNING (CWE-252): [#def25]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow24.c:49:5: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#   49 |     fgets(buffer,1024,in);
#      |     ^~~~~~~~~~~~~~~~~~~~~
#   47|     /* skip comments */
#   48|     do {
#   49|->     fgets(buffer,1024,in);
#   50|     } while(buffer[0]=='#');
#   51|   

Error: COMPILER_WARNING (CWE-252): [#def26]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow24.c:58:3: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#   58 |   fgets(buffer,1024,in);
#      |   ^~~~~~~~~~~~~~~~~~~~~
#   56|     }
#   57|     rfbLog("Got width %d and height %d.\n",width,height);
#   58|->   fgets(buffer,1024,in);
#   59|   
#   60|     /* vncviewers have problems with widths which are no multiple of 4. */

Error: COMPILER_WARNING (CWE-252): [#def27]
libvncserver-LibVNCServer-0.9.15/examples/server/pnmshow24.c:88:3: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’
#   88 |   fread(rfbScreen->frameBuffer,width*3,height,in);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   86|     if(!rfbScreen->frameBuffer)
#   87|       return 1;
#   88|->   fread(rfbScreen->frameBuffer,width*3,height,in);
#   89|     fclose(in);
#   90|   

Error: COMPILER_WARNING (CWE-252): [#def28]
libvncserver-LibVNCServer-0.9.15/examples/server/vncev.c: scope_hint: In function ‘read_keys’
libvncserver-LibVNCServer-0.9.15/examples/server/vncev.c:46:7: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#   46 |       fgets(buffer,1024,keysyms);
#      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~
#   44|      
#   45|      while(!feof(keysyms)) {
#   46|->       fgets(buffer,1024,keysyms);
#   47|         if(!strncmp(buffer,"#define XK_",strlen("#define XK_"))) {
#   48|   	 for(i=strlen("#define XK_");buffer[i] && buffer[i]!=' '

Error: COMPILER_WARNING (CWE-681): [#def29]
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c: scope_hint: In function ‘main’
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:65:33: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘get_window_size’ differ in signedness
#   65 |     get_window_size(conn, root, &width, &height);
#      |                                 ^~~~~~
#      |                                 |
#      |                                 int16_t * {aka short int *}
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:14:77: note: expected ‘uint16_t *’ {aka ‘short unsigned int *’} but argument is of type ‘int16_t *’ {aka ‘short int *’}
#   14 | void get_window_size(xcb_connection_t* conn, xcb_window_t window, uint16_t* width, uint16_t* height);
#      |                                                                   ~~~~~~~~~~^~~~~
#   63|       int16_t width;
#   64|       int16_t height;
#   65|->     get_window_size(conn, root, &width, &height);
#   66|       void* frameBuffer = malloc(4UL * width * height);
#   67|   

Error: COMPILER_WARNING (CWE-681): [#def30]
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:65:41: warning[-Wpointer-sign]: pointer targets in passing argument 4 of ‘get_window_size’ differ in signedness
#   65 |     get_window_size(conn, root, &width, &height);
#      |                                         ^~~~~~~
#      |                                         |
#      |                                         int16_t * {aka short int *}
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:14:94: note: expected ‘uint16_t *’ {aka ‘short unsigned int *’} but argument is of type ‘int16_t *’ {aka ‘short int *’}
#   14 | void get_window_size(xcb_connection_t* conn, xcb_window_t window, uint16_t* width, uint16_t* height);
#      |                                                                                    ~~~~~~~~~~^~~~~~
#   63|       int16_t width;
#   64|       int16_t height;
#   65|->     get_window_size(conn, root, &width, &height);
#   66|       void* frameBuffer = malloc(4UL * width * height);
#   67|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def31]
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:99:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘s2’ where non-null expected
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:55:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:66:25: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:80:9: call_function: calling ‘dirty_copy’ from ‘main’
#   97|               const void* s1 = &rfbScreen->frameBuffer[(y*width+x)*nbytes];
#   98|               const void* s2 = &data[(y*width+x)*nbytes];
#   99|->             if (memcmp(s1, s2, nbytes) != 0)
#  100|               {
#  101|                   dirty = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def32]
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:120:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buff’
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:55:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:66:25: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/examples/server/x11.c:79:9: call_function: calling ‘get_window_image’ from ‘main’
#  118|           for(uint16_t x = 0; x < width; x++)
#  119|           {
#  120|->             buff[(y*width+x)*4] = in[(y*width+x)*4 + 2];
#  121|               buff[(y*width+x)*4 + 1] = in[(y*width+x)*4 + 1];
#  122|               buff[(y*width+x)*4 + 2] = in[(y*width+x)*4];

Error: COMPILER_WARNING (CWE-686): [#def33]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-1jVLEu/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘strstr’; expected ‘char *(const char *, const char *)’

Error: COMPILER_WARNING (CWE-686): [#def34]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-ER2Z6X/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘memset’; expected ‘void *(void *, int,  long unsigned int)’

Error: COMPILER_WARNING (CWE-686): [#def35]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-PdEh00/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘vprintf’; expected ‘int(const char *, __va_list_tag *)’

Error: COMPILER_WARNING (CWE-686): [#def36]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-RjNRz6/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘strchr’; expected ‘char *(const char *, int)’

Error: COMPILER_WARNING (CWE-686): [#def37]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-U7bthb/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘fork’; expected ‘int(void)’

Error: COMPILER_WARNING (CWE-686): [#def38]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-Wuthjk/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘memmove’; expected ‘void *(void *, const void *, long unsigned int)’

Error: COMPILER_WARNING (CWE-686): [#def39]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-oJmXOA/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘strcspn’; expected ‘long unsigned int(const char *, const char *)’

Error: COMPILER_WARNING (CWE-686): [#def40]
libvncserver-LibVNCServer-0.9.15/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-vCH4wh/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘strdup’; expected ‘char *(const char *)’

Error: GCC_ANALYZER_WARNING (CWE-457): [#def41]
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:153:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘palette[<unknown>]’
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:81:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:82:18: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:84:11: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:89:10: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:92:7: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:257:12: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:260:17: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:263:14: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:267:23: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:271:11: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:141:14: branch_true: following ‘true’ branch (when ‘last_type <= 16’)...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:145:37: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:144:16: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:149:26: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:149:41: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:151:27: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:151:44: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:153:30: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:153:21: danger: use of uninitialized value ‘palette[<unknown>]’ here
#  151|                 for (i = x, shift = 8 - bpp; i < x + w; i++) {
#  152|                   ((CARDBPP *)client->frameBuffer)[j + i] =
#  153|->                     palette[((*buffer) >> shift) & mask];
#  154|                   shift -= bpp;
#  155|                   if (shift < 0) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def42]
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:218:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘palette[<unknown>]’
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:81:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:82:18: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:84:11: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:89:10: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:92:7: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:213:16: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:216:16: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:216:14: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:218:27: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/trle.c:218:19: danger: use of uninitialized value ‘palette[<unknown>]’ here
#  216|             if (!ReadFromRFBServer(client, (char *)buffer, 1))
#  217|               return FALSE;
#  218|->           color = palette[(*buffer) & 0x7f];
#  219|             length = 1;
#  220|             if (*buffer & 0x80) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def43]
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:315:80: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘palette[<unknown>]’
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:84:1: enter_function: entry to ‘HandleZRLE24’
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:111:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:114:21: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:145:16: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:148:20: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:156:20: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:159:17: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:166:20: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:170:20: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:170:20: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:181:23: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:191:12: branch_true: following ‘true’ branch (when ‘inflateResult == 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:192:23: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:197:26: branch_true: following ‘true’ branch (when ‘j < rh’)...
 branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:198:34: branch_true: following ‘true’ branch (when ‘i < rw’)...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:199:46: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:201:44: call_function: calling ‘HandleZRLETile24’ from ‘HandleZRLE24’
#  313|   			for(j=y*client->width; j<(y+h)*client->width; j+=client->width) {
#  314|   				for(i=x,shift=8-bpp; i<x+w; i++) {
#  315|-> 					((CARDBPP*)client->frameBuffer)[j+i] = palette[((*buffer)>>shift)&mask];
#  316|   					shift-=bpp;
#  317|   					if(shift<0) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def44]
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:384:41: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘palette[<unknown>]’
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:84:1: enter_function: entry to ‘HandleZRLE24’
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:111:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:114:21: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:145:16: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:148:20: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:156:20: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:159:17: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:166:20: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:170:20: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:170:20: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:181:23: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:191:12: branch_true: following ‘true’ branch (when ‘inflateResult == 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:192:23: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:197:26: branch_true: following ‘true’ branch (when ‘j < rh’)...
 branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:198:34: branch_true: following ‘true’ branch (when ‘i < rw’)...
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:199:46: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncclient/zrle.c:201:44: call_function: calling ‘HandleZRLETile24’ from ‘HandleZRLE24’
#  382|   				if(buffer>=buffer_end)
#  383|   					return -10;
#  384|-> 				color = palette[(*buffer)&0x7f];
#  385|   				length=1;
#  386|   				if(*buffer&0x80) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def45]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:48:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*src.subspan’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:838:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:845:12: call_function: calling ‘sraRgnCreateRect’ from ‘main’
#   46|     sraSpan *span;
#   47|     if (!src) return NULL;
#   48|->   span = sraSpanCreate(src->start, src->end, src->subspan);
#   49|     return span;
#   50|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def46]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:55:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*after._next’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:838:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:845:12: call_function: calling ‘sraRgnCreateRect’ from ‘main’
#   53|   sraSpanInsertAfter(sraSpan *newspan, sraSpan *after) {
#   54|     if(newspan && after) {
#   55|->     newspan->_next = after->_next;
#   56|       newspan->_prev = after;
#   57|       after->_next->_prev = newspan;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def47]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:66:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*before._prev’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:838:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:845:12: call_function: calling ‘sraRgnCreateRect’ from ‘main’
#   64|     if(newspan && before) {
#   65|       newspan->_next = before;
#   66|->     newspan->_prev = before->_prev;
#   67|       before->_prev->_next = newspan;
#   68|       before->_prev = newspan;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def48]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:119:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*s.end’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:838:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:845:12: call_function: calling ‘sraRgnCreateRect’ from ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:845:12: return_function: returning to ‘main’ from ‘sraRgnCreateRect’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:846:13: call_function: calling ‘sraRgnCreateRect’ from ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:846:13: return_function: returning to ‘main’ from ‘sraRgnCreateRect’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:847:13: call_function: calling ‘sraRgnCreateRect’ from ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:847:13: return_function: returning to ‘main’ from ‘sraRgnCreateRect’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:849:3: call_function: inlined call to ‘sraRgnPrint’ from ‘main’
#  117|   void
#  118|   sraSpanPrint(const sraSpan *s) {
#  119|->   printf("(%d-%d)", (s->start), (s->end));
#  120|     if (s->subspan)
#  121|       sraSpanListPrint(s->subspan);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def49]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:155:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*list.front._next’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:838:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:845:12: call_function: calling ‘sraRgnCreateRect’ from ‘main’
#  153|   sraSpanListDestroy(sraSpanList *list) {
#  154|     sraSpan *curr;
#  155|->   while (list->front._next != &(list->back)) {
#  156|       curr = list->front._next;
#  157|       sraSpanRemove(curr);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def50]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:719:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:718:5: branch_true: following ‘true’ branch (when ‘reverseY != 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:719:5: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:719:5: danger: dereference of NULL ‘sraRgnGetIterator(s)’
#  717|     sraRectangleIterator *i = sraRgnGetIterator(s);
#  718|     if(reverseY) {
#  719|->     i->sPtrs[1] = &(s->front);
#  720|       i->sPtrs[0] = &(s->back);
#  721|     }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def51]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:722:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:718:5: branch_false: following ‘false’ branch (when ‘reverseY == 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:722:3: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/../libvncserver/rfbregion.c:722:3: danger: dereference of NULL ‘sraRgnGetIterator(s)’
#  720|       i->sPtrs[0] = &(s->back);
#  721|     }
#  722|->   i->reverseX = reverseX;
#  723|     i->reverseY = reverseY;
#  724|     return(i);

Error: COMPILER_WARNING (CWE-1023): [#def52]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:432:5: warning[-Wswitch]: enumeration value ‘RFB_AUTHENTICATION’ not handled in switch
#  430|       }
#  431|   
#  432|->     switch (cl->state) {
#  433|       case RFB_CHANNEL_SECURITY_TYPE:
#  434|           handlerListHead = channelSecurityHandlers;

Error: COMPILER_WARNING (CWE-1023): [#def53]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:432:5: warning[-Wswitch]: enumeration value ‘RFB_INITIALISATION_SHARED’ not handled in switch
#  430|       }
#  431|   
#  432|->     switch (cl->state) {
#  433|       case RFB_CHANNEL_SECURITY_TYPE:
#  434|           handlerListHead = channelSecurityHandlers;

Error: COMPILER_WARNING (CWE-1023): [#def54]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:432:5: warning[-Wswitch]: enumeration value ‘RFB_INITIALISATION’ not handled in switch
#  430|       }
#  431|   
#  432|->     switch (cl->state) {
#  433|       case RFB_CHANNEL_SECURITY_TYPE:
#  434|           handlerListHead = channelSecurityHandlers;

Error: COMPILER_WARNING (CWE-1023): [#def55]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:432:5: warning[-Wswitch]: enumeration value ‘RFB_NORMAL’ not handled in switch
#  430|       }
#  431|   
#  432|->     switch (cl->state) {
#  433|       case RFB_CHANNEL_SECURITY_TYPE:
#  434|           handlerListHead = channelSecurityHandlers;

Error: COMPILER_WARNING (CWE-1023): [#def56]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c: scope_hint: In function ‘rfbProcessClientSecurityType’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:432:5: warning[-Wswitch]: enumeration value ‘RFB_PROTOCOL_VERSION’ not handled in switch
#  432 |     switch (cl->state) {
#      |     ^~~~~~
#  430|       }
#  431|   
#  432|->     switch (cl->state) {
#  433|       case RFB_CHANNEL_SECURITY_TYPE:
#  434|           handlerListHead = channelSecurityHandlers;

Error: COMPILER_WARNING (CWE-1023): [#def57]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:432:5: warning[-Wswitch]: enumeration value ‘RFB_SHUTDOWN’ not handled in switch
#  430|       }
#  431|   
#  432|->     switch (cl->state) {
#  433|       case RFB_CHANNEL_SECURITY_TYPE:
#  434|           handlerListHead = channelSecurityHandlers;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def58]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:442:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘handler’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:423:8: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:432:13: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:442:37: danger: use of uninitialized value ‘handler’ here
#  440|   
#  441|       /* Make sure it was present in the list sent by the server. */
#  442|->     for (handler = handlerListHead; handler; handler = handler->next) {
#  443|   	if (chosenType == handler->type) {
#  444|   	      rfbLog("rfbProcessClientSecurityType: executing handler for type %d\n", chosenType);

Error: COMPILER_WARNING (CWE-457): [#def59]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:442:37: warning[-Wmaybe-uninitialized]: ‘handlerListHead’ may be used uninitialized
#  442 |     for (handler = handlerListHead; handler; handler = handler->next) {
#      |                                     ^~~~~~~
libvncserver-LibVNCServer-0.9.15/src/libvncserver/auth.c:419:25: note: ‘handlerListHead’ was declared here
#  419 |     rfbSecurityHandler* handlerListHead;
#      |                         ^~~~~~~~~~~~~~~
#  440|   
#  441|       /* Make sure it was present in the list sent by the server. */
#  442|->     for (handler = handlerListHead; handler; handler = handler->next) {
#  443|   	if (chosenType == handler->type) {
#  444|   	      rfbLog("rfbProcessClientSecurityType: executing handler for type %d\n", chosenType);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def60]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:596:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dest’ where non-null expected
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:557:6: branch_false: following ‘false’ branch (when ‘c’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:562:12: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:564:6: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:565:10: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:567:28: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:577:14: branch_false: following ‘false’ branch (when ‘x2 > 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:582:7: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:586:14: branch_false: following ‘false’ branch (when ‘y2 > 0’)...
 branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:592:12: branch_true: following ‘true’ branch (when ‘j < y2’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:593:17: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:596:8: branch_false: following ‘false’ branch (when ‘wasChanged == 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:596:23: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/cursor.c:596:23: danger: argument 1 (‘dest’) from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) could be NULL where non-null expected
#  594|        const char* src=s->frameBuffer+(y1+j)*rowstride+x1*bpp;
#  595|        unsigned int count=x2*bpp;
#  596|->      if(wasChanged || memcmp(dest,src,count)) {
#  597|          wasChanged=TRUE;
#  598|          memcpy(dest,src,count);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def61]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:356:41: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:289:8: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:294:5: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:304:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:311:29: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:313:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:329:20: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:333:12: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:340:8: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:340:7: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:342:13: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:342:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:356:14: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:356:12: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:356:49: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/httpd.c:356:41: danger: argument 1 (‘strchr(&buf, 47)’) NULL where non-null expected
#  354|   	    return;
#  355|   	}
#  356|-> 	if (!strncmp(buf, "GET ",4) && !strncmp(strchr(buf,'/'),"/proxied.connection HTTP/1.", 27)) {
#  357|   	    /* proxy connection */
#  358|   	    rfbLog("httpd: client asked for /proxied.connection\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:672:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*(struct _rfbScreenInfo *)data.listenSock’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:638:12: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:641:9: branch_true: following ‘true’ branch (when ‘__i != 16’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:641:9: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:653:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:659:13: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:659:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:670:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:671:12: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:672:25: danger: ‘*(struct _rfbScreenInfo *)data.listenSock’ leaks here
#  670|   	len = sizeof (peer);
#  671|   	if (screen->listenSock != RFB_INVALID_SOCKET && FD_ISSET(screen->listenSock, &listen_fds))
#  672|-> 	    client_fd = accept(screen->listenSock, (struct sockaddr*)&peer, &len);
#  673|   	else if (screen->listen6Sock != RFB_INVALID_SOCKET && FD_ISSET(screen->listen6Sock, &listen_fds))
#  674|   	    client_fd = accept(screen->listen6Sock, (struct sockaddr*)&peer, &len);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:677:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:638:12: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:641:9: branch_true: following ‘true’ branch (when ‘__i != 16’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:641:9: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:653:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:659:13: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:659:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:670:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:676:11: branch_true: following ‘true’ branch (when ‘client_fd >= 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:677:16: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:677:16: danger: leaks here
#  675|   
#  676|   	if(client_fd >= 0)
#  677|-> 	  cl = rfbNewClient(screen,client_fd);
#  678|   	if (cl && !cl->onHold )
#  679|   	  rfbStartOnHoldClient(cl);

Error: COMPILER_WARNING (CWE-252): [#def64]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c: scope_hint: In function ‘rfbShutdownServer’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/main.c:1242:7: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
# 1242 |       write(screen->pipe_notify_listener_thread[1], "\x00", 1);
#      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1240|   	in listenerRun, the loop in there will then break because the rfbShutdownSockets() above has set screen->socketState.
# 1241|         */
# 1242|->       write(screen->pipe_notify_listener_thread[1], "\x00", 1);
# 1243|         /* And wait for it to finish. */
# 1244|         pthread_join(screen->listener_thread, NULL);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def65]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:48:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*src.subspan’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:591:12: enter_function: entry to ‘sraRgnBBox’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:595:5: branch_false: following ‘false’ branch (when ‘src’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:598:3: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:617:5: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:620:10: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:620:10: call_function: calling ‘sraRgnCreateRect’ from ‘sraRgnBBox’
#   46|     sraSpan *span;
#   47|     if (!src) return NULL;
#   48|->   span = sraSpanCreate(src->start, src->end, src->subspan);
#   49|     return span;
#   50|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def66]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:55:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*after._next’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:591:12: enter_function: entry to ‘sraRgnBBox’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:595:5: branch_false: following ‘false’ branch (when ‘src’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:598:3: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:617:5: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:620:10: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:620:10: call_function: calling ‘sraRgnCreateRect’ from ‘sraRgnBBox’
#   53|   sraSpanInsertAfter(sraSpan *newspan, sraSpan *after) {
#   54|     if(newspan && after) {
#   55|->     newspan->_next = after->_next;
#   56|       newspan->_prev = after;
#   57|       after->_next->_prev = newspan;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def67]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:66:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*before._prev’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:567:1: enter_function: entry to ‘sraRgnSubtract’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:568:10: call_function: calling ‘sraSpanListSubtract’ from ‘sraRgnSubtract’
#   64|     if(newspan && before) {
#   65|       newspan->_next = before;
#   66|->     newspan->_prev = before->_prev;
#   67|       before->_prev->_next = newspan;
#   68|       before->_prev = newspan;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def68]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:155:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*list.front._next’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:591:12: enter_function: entry to ‘sraRgnBBox’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:595:5: branch_false: following ‘false’ branch (when ‘src’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:598:3: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:617:5: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:620:10: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:620:10: call_function: calling ‘sraRgnCreateRect’ from ‘sraRgnBBox’
#  153|   sraSpanListDestroy(sraSpanList *list) {
#  154|     sraSpan *curr;
#  155|->   while (list->front._next != &(list->back)) {
#  156|       curr = list->front._next;
#  157|       sraSpanRemove(curr);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def69]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:719:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:718:5: branch_true: following ‘true’ branch (when ‘reverseY != 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:719:5: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:719:5: danger: dereference of NULL ‘sraRgnGetIterator(s)’
#  717|     sraRectangleIterator *i = sraRgnGetIterator(s);
#  718|     if(reverseY) {
#  719|->     i->sPtrs[1] = &(s->front);
#  720|       i->sPtrs[0] = &(s->back);
#  721|     }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def70]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:722:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:718:5: branch_false: following ‘false’ branch (when ‘reverseY == 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:722:3: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbregion.c:722:3: danger: dereference of NULL ‘sraRgnGetIterator(s)’
#  720|       i->sPtrs[0] = &(s->back);
#  721|     }
#  722|->   i->reverseX = reverseX;
#  723|     i->reverseY = reverseY;
#  724|     return(i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:212:6: warning[-Wanalyzer-malloc-leak]: leak of ‘rfbGetClientIterator(*cl.screen)’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:2219:1: enter_function: entry to ‘rfbProcessClientNormalMessage’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:2238:8: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:2245:13: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3022:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3030:13: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3030:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3035:60: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3036:12: branch_false: following ‘false’ branch (when ‘extDesktopScreens’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3042:18: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3042:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3050:60: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3068:12: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3070:24: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3070:24: call_function: calling ‘rfbGetClientIterator’ from ‘rfbProcessClientNormalMessage’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3070:24: return_function: returning to ‘rfbProcessClientNormalMessage’ from ‘rfbGetClientIterator’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3071:27: call_function: calling ‘rfbClientIteratorNext’ from ‘rfbProcessClientNormalMessage’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3071:27: return_function: returning to ‘rfbProcessClientNormalMessage’ from ‘rfbClientIteratorNext’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:212:6: danger: ‘rfbGetClientIterator(*cl.screen)’ leaks here; was allocated at [(18)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/17)
#  210|     if (!i)
#  211|       return NULL;
#  212|->   if(i->next == 0) {
#  213|       LOCK(rfbClientListMutex);
#  214|       i->next = i->screen->clientHead;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1420:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1653:9: enter_function: entry to ‘rfbProcessFileTransfer’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1670:5: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1676:5: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1710:27: call_function: calling ‘rfbProcessFileTransferReadBuffer’ from ‘rfbProcessFileTransfer’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1710:27: return_function: returning to ‘rfbProcessFileTransfer’ from ‘rfbProcessFileTransferReadBuffer’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1710:16: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1711:22: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1711:22: call_function: calling ‘rfbSendDirContent’ from ‘rfbProcessFileTransfer’
# 1418|   
# 1419|       /* send back the path name (necessary for links) */
# 1420|->     if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, length, buffer)==FALSE) return FALSE;
# 1421|   
# 1422|   #ifdef WIN32

Error: CPPCHECK_WARNING (CWE-401): [#def73]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:1762: error[memleakOnRealloc]: Common realloc mistake: 'buffer' nulled but not freed upon failure
# 1760|                 /* Add the File Time Stamp to the filename */
# 1761|                 strftime(timespec, sizeof(timespec), "%m/%d/%Y %H:%M",gmtime(&statbuf.st_ctime));
# 1762|->               buffer=realloc(buffer, length + strlen(timespec) + 2); /* comma, and Null term */
# 1763|                 if (buffer==NULL) {
# 1764|                     rfbLog("rfbProcessFileTransfer() rfbFileTransferRequest: Failed to malloc %d bytes\n", length + strlen(timespec) + 2);

Error: COMPILER_WARNING (CWE-563): [#def74]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c: scope_hint: In function ‘rfbSendExtendedServerCutTextData’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:2088:9: warning[-Wunused-variable]: unused variable ‘i’
# 2088 |     int i;
#      |         ^
# 2086|   static rfbBool
# 2087|   rfbSendExtendedServerCutTextData(rfbClientPtr cl, const char *data, int len) {
# 2088|->     int i;
# 2089|       unsigned long size;
# 2090|       uint32_t tmpInt;

Error: COMPILER_WARNING (CWE-704): [#def75]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c: scope_hint: In function ‘rfbProcessExtendedServerCutTextData’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:2155:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2155 |     stream.next_in = data;
#      |                    ^
# 2153|       }
# 2154|       stream.avail_in = len;
# 2155|->     stream.next_in = data;
# 2156|       for (i = 0; i < 16; i++) {
# 2157|           if (!(flags & (1 << i))) {

Error: COMPILER_WARNING (CWE-704): [#def76]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:2155:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2153|       }
# 2154|       stream.avail_in = len;
# 2155|->     stream.next_in = data;
# 2156|       for (i = 0; i < 16; i++) {
# 2157|           if (!(flags & (1 << i))) {

Error: CPPCHECK_WARNING (CWE-476): [#def77]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3948: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: scme
# 3946|       rgb = (uint16_t *)(&wbuf[sz_rfbSetColourMapEntriesMsg]);
# 3947|   
# 3948|->     scme->type = rfbSetColourMapEntries;
# 3949|   
# 3950|       scme->firstColour = Swap16IfLE(firstColour);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def78]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3948:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘wbuf’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3940:8: branch_true: following ‘true’ branch (when ‘nColours > 256’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3942:32: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3942:25: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3948:5: danger: ‘wbuf’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 3946|       rgb = (uint16_t *)(&wbuf[sz_rfbSetColourMapEntriesMsg]);
# 3947|   
# 3948|->     scme->type = rfbSetColourMapEntries;
# 3949|   
# 3950|       scme->firstColour = Swap16IfLE(firstColour);

Error: CPPCHECK_WARNING (CWE-457): [#def79]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/rfbserver.c:3972: warning[uninitvar]: Uninitialized variable: wbuf
# 3970|   
# 3971|       LOCK(cl->sendMutex);
# 3972|->     if (rfbWriteExact(cl, wbuf, len) < 0) {
# 3973|   	rfbLogPerror("rfbSendSetColourMapEntries: write");
# 3974|   	rfbCloseClient(cl);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def80]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/scale.c:288:9: warning[-Wanalyzer-null-argument]: use of NULL ‘*cl.screen’ where non-null expected
libvncserver-LibVNCServer-0.9.15/src/libvncserver/scale.c:353:6: enter_function: entry to ‘rfbScalingSetup’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/scale.c:357:11: call_function: calling ‘rfbScalingFind’ from ‘rfbScalingSetup’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/scale.c:357:11: return_function: returning to ‘rfbScalingSetup’ from ‘rfbScalingFind’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/scale.c:358:8: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/scale.c:359:15: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/scale.c:359:15: call_function: calling ‘rfbScaledScreenAllocate’ from ‘rfbScalingSetup’
#argument 2 of ‘__builtin_memcpy’ must be non-null
#  286|   
#  287|           /* copy *everything* (we don't use most of it, but just in case) */
#  288|->         memcpy(ptr, cl->screen, sizeof(rfbScreenInfo));
#  289|   
#  290|           /* SECURITY: make sure that no integer overflow will occur afterwards.

Error: COMPILER_WARNING (CWE-252): [#def81]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c: scope_hint: In function ‘rfbCloseClient’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:602:9: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  602 |         write(cl->pipe_notify_client_thread[1], "\x00", 1);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  600|   	  RFB_SHUTDOWN. Client socket closing will be done by the thread.
#  601|   	*/
#  602|-> 	write(cl->pipe_notify_client_thread[1], "\x00", 1);
#  603|   	/*
#  604|   	  No joining of threads here, this is fire and forget.

Error: COMPILER_WARNING (CWE-758): [#def82]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c: scope_hint: In function ‘rfbReadExactTimeout’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:757:32: warning[-Wrestrict]: passing argument 2 to ‘restrict’-qualified parameter aliases with argument 4
#  757 |             n = select(sock+1, &fds, NULL, &fds, &tv);
#      |                                ^~~~        ~~~~
#  755|               tv.tv_sec = timeout / 1000;
#  756|               tv.tv_usec = (timeout % 1000) * 1000;
#  757|->             n = select(sock+1, &fds, NULL, &fds, &tv);
#  758|               if (n < 0) {
#  759|                   rfbLogPerror("ReadExact: select");

Error: CPPCHECK_WARNING (CWE-758): [#def83]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:798: error[missingReturn]: Found an exit path from function with non-void return type that has missing return statement
#  796|   rfbPeekAtSocket(rfbClientPtr cl, char *buf, int len)
#  797|   {
#  798|->     cl->peekAtSocket(cl, buf, len);
#  799|   }
#  800|   

Error: COMPILER_WARNING (CWE-393): [#def84]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c: scope_hint: In function ‘rfbPeekAtSocket’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:799:1: warning[-Wreturn-type]: control reaches end of non-void function
#  799 | }
#      | ^
#  797|   {
#  798|       cl->peekAtSocket(cl, buf, len);
#  799|-> }
#  800|   
#  801|   /*

Error: GCC_ANALYZER_WARNING (CWE-457): [#def85]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:831:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘n’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:823:12: branch_true: following ‘true’ branch (when ‘len > 0’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:825:13: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:825:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:829:17: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:831:12: danger: use of uninitialized value ‘n’ here
#  829|               n = rfbPeekAtSocket(cl, buf, len);
#  830|   
#  831|->         if (n == len) {
#  832|   
#  833|               break;

Error: COMPILER_WARNING (CWE-758): [#def86]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c: scope_hint: In function ‘rfbPeekExactTimeout’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:863:32: warning[-Wrestrict]: passing argument 2 to ‘restrict’-qualified parameter aliases with argument 4
#  863 |             n = select(sock+1, &fds, NULL, &fds, &tv);
#      |                                ^~~~        ~~~~
#  861|               tv.tv_sec = timeout / 1000;
#  862|               tv.tv_usec = (timeout % 1000) * 1000;
#  863|->             n = select(sock+1, &fds, NULL, &fds, &tv);
#  864|               if (n < 0) {
#  865|                   rfbLogPerror("PeekExact: select");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def87]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1265:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1264:17: acquire_resource: datagram socket created here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1264:8: branch_false: following ‘false’ branch (when ‘sock != -1’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1267:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1267:8: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1271:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1271:9: acquire_resource: socket created here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1271:8: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/sockets.c:1265:16: danger: ‘sock’ leaks here
# 1263|   
# 1264|       if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == RFB_INVALID_SOCKET) {
# 1265|-> 	return RFB_INVALID_SOCKET;
# 1266|       }
# 1267|       if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:60:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*table’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:41:22: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:44:17: branch_true: following ‘true’ branch (when ‘i < nEntries’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:46:16: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:60:9: danger: ‘malloc((long unsigned int)((3 << (int)*in.bitsPerPixel) + 1)) + (sizetype)(i * 3)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#   58|                   (((g * (1 + out->greenMax)) >> shift) << out->greenShift) |
#   59|                   (((b * (1 + out->blueMax)) >> shift) << out->blueShift));
#   60|-> 	*(uint32_t*)&t[3*i] = outValue;
#   61|   	if(!rfbEndianTest)
#   62|   	  memmove(t+3*i,t+3*i+1,3);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def89]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:100:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*table’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:85:22: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:88:17: branch_true: following ‘true’ branch (when ‘i < nEntries’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:89:25: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:100:9: danger: ‘malloc((long unsigned int)((3 << (int)*in.bitsPerPixel) + 1)) + (sizetype)(i * 3)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#   98|                   (outGreen << out->greenShift) |
#   99|                   (outBlue  << out->blueShift));
#  100|-> 	*(uint32_t*)&t[3*i] = outValue;
#  101|   	if(!rfbEndianTest)
#  102|   	  memmove(t+3*i,t+3*i+1,3);

Error: CPPCHECK_WARNING (CWE-682): [#def90]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:127: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
#  125|                               * 3 + 1);
#  126|       redTable = (uint8_t *)*table;
#  127|->     greenTable = redTable + 3*(in->redMax + 1);
#  128|       blueTable = greenTable + 3*(in->greenMax + 1);
#  129|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def91]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:149:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘table’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:116:1: enter_function: entry to ‘rfbInitTrueColourRGBTables24’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:124:22: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:130:5: call_function: calling ‘rfbInitOneRGBTable24’ from ‘rfbInitTrueColourRGBTables24’
#  147|       for (i = 0; i < nEntries; i++) {
#  148|         outValue = ((i * outMax + inMax / 2) / inMax) << outShift;
#  149|->       *(uint32_t *)&table[3*i] = outValue;
#  150|         if(!rfbEndianTest) {
#  151|   	memmove(table+3*i,table+3*i+1,3);

Error: CPPCHECK_WARNING (CWE-476): [#def92]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:154: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  152|         }
#  153|         if (swap) {
#  154|->         c = table[3*i]; table[3*i] = table[3*i+2];
#  155|           table[3*i+2] = c;
#  156|         }

Error: CPPCHECK_WARNING (CWE-476): [#def93]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinit24.c:155: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  153|         if (swap) {
#  154|           c = table[3*i]; table[3*i] = table[3*i+2];
#  155|->         table[3*i+2] = c;
#  156|         }
#  157|       }

Error: CPPCHECK_WARNING (CWE-476): [#def94]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinitcmtemplate.c:71: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: t
#   69|   	  }
#   70|   	}
#   71|->         t[i] = ((((r * (1 + out->redMax)) >> shift) << out->redShift) |
#   72|                   (((g * (1 + out->greenMax)) >> shift) << out->greenShift) |
#   73|                   (((b * (1 + out->blueMax)) >> shift) << out->blueShift));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def95]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinitcmtemplate.c:71:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*table’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinitcmtemplate.c:55:22: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinitcmtemplate.c:58:17: branch_true: following ‘true’ branch (when ‘i < nEntries’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinitcmtemplate.c:60:16: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinitcmtemplate.c:71:9: danger: ‘malloc((long unsigned int)nEntries) + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   69|   	  }
#   70|   	}
#   71|->         t[i] = ((((r * (1 + out->redMax)) >> shift) << out->redShift) |
#   72|                   (((g * (1 + out->greenMax)) >> shift) << out->greenShift) |
#   73|                   (((b * (1 + out->blueMax)) >> shift) << out->blueShift));

Error: CPPCHECK_WARNING (CWE-476): [#def96]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:81: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: t
#   79|           outBlue  = (inBlue  * out->blueMax  + in->blueMax / 2)  / in->blueMax;
#   80|   
#   81|->         t[i] = ((outRed   << out->redShift)   |
#   82|                   (outGreen << out->greenShift) |
#   83|                   (outBlue  << out->blueShift));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def97]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:81:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*table’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:69:22: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:72:17: branch_true: following ‘true’ branch (when ‘i < nEntries’)...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:73:25: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:81:9: danger: ‘malloc((long unsigned int)nEntries) + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   79|           outBlue  = (inBlue  * out->blueMax  + in->blueMax / 2)  / in->blueMax;
#   80|   
#   81|->         t[i] = ((outRed   << out->redShift)   |
#   82|                   (outGreen << out->greenShift) |
#   83|                   (outBlue  << out->blueShift));

Error: CPPCHECK_WARNING (CWE-682): [#def98]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:110: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
#  108|                               * sizeof(OUT_T));
#  109|       redTable = (OUT_T *)*table;
#  110|->     greenTable = redTable + in->redMax + 1;
#  111|       blueTable = greenTable + in->greenMax + 1;
#  112|   

Error: CPPCHECK_WARNING (CWE-476): [#def99]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:130: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  128|       for (i = 0; i < nEntries; i++) {
#  129|           if (outShift < 32) {
#  130|->             table[i] = ((OUT_T)((i * outMax + inMax / 2) / inMax)) << outShift;
#  131|           } else {
#  132|               table[i] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def100]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:130:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘table’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:99:1: enter_function: entry to ‘rfbInitTrueColourRGBTables8’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:107:22: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:113:5: call_function: calling ‘rfbInitOneRGBTable8’ from ‘rfbInitTrueColourRGBTables8’
#  128|       for (i = 0; i < nEntries; i++) {
#  129|           if (outShift < 32) {
#  130|->             table[i] = ((OUT_T)((i * outMax + inMax / 2) / inMax)) << outShift;
#  131|           } else {
#  132|               table[i] = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def101]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:132: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  130|               table[i] = ((OUT_T)((i * outMax + inMax / 2) / inMax)) << outShift;
#  131|           } else {
#  132|->             table[i] = 0;
#  133|           }
#  134|   #if (OUT != 8)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def102]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:132:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘table’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:99:1: enter_function: entry to ‘rfbInitTrueColourRGBTables8’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:107:22: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:113:5: call_function: calling ‘rfbInitOneRGBTable8’ from ‘rfbInitTrueColourRGBTables8’
#  130|               table[i] = ((OUT_T)((i * outMax + inMax / 2) / inMax)) << outShift;
#  131|           } else {
#  132|->             table[i] = 0;
#  133|           }
#  134|   #if (OUT != 8)

Error: CPPCHECK_WARNING (CWE-476): [#def103]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tableinittctemplate.c:136: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  134|   #if (OUT != 8)
#  135|           if (swap) {
#  136|->             table[i] = SwapOUT(table[i]);
#  137|           }
#  138|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:202:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetHomeDir(uid)’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:80:1: enter_function: entry to ‘InitFileTransfer’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:89:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:92:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:96:20: call_function: calling ‘GetHomeDir’ from ‘InitFileTransfer’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:96:20: return_function: returning to ‘InitFileTransfer’ from ‘GetHomeDir’
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:98:11: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:98:34: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/src/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:202:12: danger: ‘GetHomeDir(uid)’ leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#  200|   		return NULL;
#  201|   
#  202|-> 	if(pwEnt->pw_dir != NULL) {
#  203|   		homedir = strdup (pwEnt->pw_dir);
#  204|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
libvncserver-LibVNCServer-0.9.15/test/bmp.c:267:16: warning[-Wanalyzer-malloc-leak]: leak of ‘tempbuf’
libvncserver-LibVNCServer-0.9.15/test/bmp.c:188:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:190:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:192:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:192:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:194:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:194:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:197:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:202:11: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:202:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:208:9: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:208:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:209:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:210:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:211:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:212:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:213:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:214:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:215:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:216:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:217:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:218:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:219:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:220:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:221:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:222:9: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:241:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:241:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:244:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:248:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:249:20: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:252:11: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:253:38: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:253:38: acquire_memory: allocated here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:253:11: branch_false: following ‘false’ branch (when ‘tempbuf’ is non-NULL)...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:254:52: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:253:12: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:256:12: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:256:11: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:257:17: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:265:11: branch_false: following ‘false’ branch (when ‘tempbuf’ is NULL)...
 branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:266:11: branch_true: following ‘true’ branch...
libvncserver-LibVNCServer-0.9.15/test/bmp.c:266:20: branch_true: ...to here
libvncserver-LibVNCServer-0.9.15/test/bmp.c:267:16: danger: ‘tempbuf’ leaks here; was allocated at [(53)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/52)
#  265|   	if(tempbuf) free(tempbuf);
#  266|   	if(fd!=-1) close(fd);
#  267|-> 	return retcode;
#  268|   }
#  269|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def106]
libvncserver-LibVNCServer-0.9.15/test/copyrecttest.c:14:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*server.frameBuffer + (sizetype)(((unsigned int)*server.width * j + i) * 4)’
libvncserver-LibVNCServer-0.9.15/test/copyrecttest.c:20:5: enter_function: entry to ‘main’
libvncserver-LibVNCServer-0.9.15/test/copyrecttest.c:26:5: branch_false: following ‘false’ branch...
libvncserver-LibVNCServer-0.9.15/test/copyrecttest.c:28:30: branch_false: ...to here
libvncserver-LibVNCServer-0.9.15/test/copyrecttest.c:28:30: acquire_memory: this call could return NULL
libvncserver-LibVNCServer-0.9.15/test/copyrecttest.c:29:3: call_function: calling ‘initBackground’ from ‘main’
#   12|     for(i=0;i<server->width;i++)
#   13|       for(j=0;j<server->height;j++) {
#   14|->       server->frameBuffer[(j*server->width+i)*4+0]=i&0xff;
#   15|         server->frameBuffer[(j*server->width+i)*4+1]=j&0xff;
#   16|         server->frameBuffer[(j*server->width+i)*4+2]=(i*j)&0xff;

Error: COMPILER_WARNING: [#def107]
libvncserver-LibVNCServer-0.9.15/test/encodingstest.c: scope_hint: In function ‘main’
libvncserver-LibVNCServer-0.9.15/test/encodingstest.c:202:31: warning[-Wformat-overflow=]: ‘%d’ directive writing between 1 and 11 bytes into a region of size 7
#  202 |         sprintf(cd->display,":%d",server->port-5900);
#      |                               ^~
libvncserver-LibVNCServer-0.9.15/test/encodingstest.c:202:29: note: directive argument in the range [-2147483648, 2147477747]
#  202 |         sprintf(cd->display,":%d",server->port-5900);
#      |                             ^~~~~
/usr/include/bits/stdio2.h:30:10: note: ‘__sprintf_chk’ output between 3 and 13 bytes into a destination of size 8
#   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   31 |                                   __glibc_objsize (__s), __fmt,
#      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   32 |                                   __va_arg_pack ());
#      |                                   ~~~~~~~~~~~~~~~~~
#  200|   	cd->encodingIndex=encodingIndex;
#  201|   	cd->server=server;
#  202|-> 	sprintf(cd->display,":%d",server->port-5900);
#  203|   	rfbClientSetClientData(client, clientLoop, cd);
#  204|   

Error: COMPILER_WARNING: [#def108]
libvncserver-LibVNCServer-0.9.15/test/tjbench.c: scope_hint: In function ‘decomptest’
libvncserver-LibVNCServer-0.9.15/test/tjbench.c:96:41: warning[-Wformat-truncation=]: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 4
#   96 |                 snprintf(qualstr, 6, "_Q%d", jpegqual);
#      |                                         ^~
libvncserver-LibVNCServer-0.9.15/test/tjbench.c:96:38: note: directive argument in the range [1, 2147483647]
#   96 |                 snprintf(qualstr, 6, "_Q%d", jpegqual);
#      |                                      ^~~~~~
/usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 4 and 13 bytes into a destination of size 6
#   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   69 |                                    __glibc_objsize (__s), __fmt,
#      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   70 |                                    __va_arg_pack ());
#      |                                    ~~~~~~~~~~~~~~~~~
#   94|   	if(jpegqual>0)
#   95|   	{
#   96|-> 		snprintf(qualstr, 6, "_Q%d", jpegqual);
#   97|   		qualstr[5]=0;
#   98|   	}

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-240.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibvncserver-0.9.15-3.fc43
store-results-to/tmp/tmptc0zab2x/libvncserver-0.9.15-3.fc43.tar.xz
time-created2025-04-25 14:18:08
time-finished2025-04-25 14:20:20
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmptc0zab2x/libvncserver-0.9.15-3.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmptc0zab2x/libvncserver-0.9.15-3.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9