We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
<sstream>
1 parent 5c414fc commit 358715eCopy full SHA for 358715e
1 file changed
fuzzer.cpp
@@ -2,7 +2,6 @@
2
#include <cstdlib>
3
#include <iomanip>
4
#include <libgen.h>
5
-#include <sstream>
6
#include <vector>
7
#include <string>
8
#include <optional>
@@ -17,9 +16,8 @@
17
16
18
static std::string ToAbsolutePath(const std::string argv0, const std::string relativePath) {
19
char absoluteRootPath[PATH_MAX+1];
20
- char argv0Copy[argv0.size()+1];
21
- memcpy(argv0Copy, argv0.c_str(), argv0.size()+1);
22
- if ( realpath(dirname(argv0Copy), absoluteRootPath) == nullptr ) {
+ std::vector<char> argv0Copy(argv0.c_str(), argv0.c_str() + argv0.size() + 1);
+ if ( realpath(dirname(argv0Copy.data()), absoluteRootPath) == nullptr ) {
23
printf("Fatal error: Cannot resolve absolute root path\n");
24
abort();
25
}
0 commit comments