File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2828#include "glslang_util.h"
2929#include "../../verbosity.h"
3030
31- static char * slang_get_include_file (const char * line )
31+ static char * slang_get_include_file (const char * line , size_t len )
3232{
3333 char * end = NULL ;
34- char * start = (char * )strchr (line , '\"' );
34+ char * start = (char * )memchr (line , '\"' , len + 1 );
3535 if (!start )
3636 return NULL ;
3737 start ++ ;
38- if (!(end = (char * )strchr (start , '\"' )))
38+ if (!(end = (char * )memchr (start , '\"' , len - ( start - line ) )))
3939 return NULL ;
4040 * end = '\0' ;
4141 return start ;
@@ -226,7 +226,7 @@ bool glslang_read_shader_file(const char *path,
226226 if ( !strncmp ("#include " , line , STRLEN_CONST ("#include " )) || include_optional )
227227 {
228228 char include_path [PATH_MAX_LENGTH ];
229- char * include_file = slang_get_include_file (line );
229+ char * include_file = slang_get_include_file (line , strlen ( line ) );
230230
231231 if (string_is_empty (include_file ))
232232 {
You can’t perform that action at this time.
0 commit comments