Skip to content

Commit bd7f33b

Browse files
committed
Escape trigraph sequences in backtrace
Sequences of '??)' are trigraphs which could be replaced by a compiler with some other character.
1 parent ea91348 commit bd7f33b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/loader/layers/validation/backtrace_libbacktrace.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ int backtrace_cb(void *data, uintptr_t pc, const char *filename, int lineno,
4242
} else if (function != NULL) {
4343
backtraceLine << "(" << function << ") ";
4444
} else {
45-
backtraceLine << "(????????) ";
45+
// Note: Escaping the last '?' character to avoid creation of a trigraph character
46+
backtraceLine << "(???????\?) ";
4647
}
4748

4849
char filepath[PATH_MAX];
4950
if (realpath(filename, filepath) != NULL) {
5051
backtraceLine << "(" << filepath << ":" << std::dec << lineno << ")";
5152
} else {
52-
backtraceLine << "(????????)";
53+
// Note: Escaping the last '?' character to avoid creation of a trigraph character
54+
backtraceLine << "(???????\?)";
5355
}
5456

5557
std::vector<std::string> *backtrace =

0 commit comments

Comments
 (0)