History

fixed issue resetting console output header [chuck]; added max length check on input filename

Ge Wang committed 5 years ago

Commit ded05be1 parent 58b142a3 files · +89 −50Browse files

Showing the changes to src/core/chuck_parse.cpp (1 of 3 files). Show all

Unified · Split

src/core/chuck_parse.cpp+13−1
@@ -36,8 +36,10 @@ · 35 unmodified lines
3636 using namespace std;
3737
3838
39+// max path len
40+static const t_CKUINT MAX_FILENAME_LEN = 2048;
3941 // global
40−static char g_filename[1024] = "";
42+static char g_filename[MAX_FILENAME_LEN+1] = "";
4143
4244 // external
4345 extern "C" {
@@ -178,6 +180,16 @@ t_CKBOOL chuck_parse( c_constr fname, FILE * fd, c_constr code ) · 134 unmodified lines
178180 }
179181 */
180182
183+ // check length | 1.4.1.0 (ge) added
184+ t_CKUINT len = strlen( fname );
185+ if( len > MAX_FILENAME_LEN )
186+ {
187+ EM_error2( 0, "filename length (%d) exceeds max (%d) set by compiler...",
188+ len, MAX_FILENAME_LEN );
189+ EM_error2( 0, "filename in question: '%s'", fname );
190+ EM_error2( 0, "compiler bailing out..." );
191+ return FALSE;
192+ }
181193 // remember filename
182194 strcpy( g_filename, fname );
183195

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t