<div dir="ltr"><div>Bug: <a href="https://bugs.llvm.org/show_bug.cgi?id=38116">https://bugs.llvm.org/show_bug.cgi?id=38116</a></div><div><br></div><div>File: llvm-mirror/clang/blob/master/lib/Frontend/ModuleDependencyCollector.cpp#L108</div><br>i.e<br>if (!realpath(SrcPath.str().c_str(), CanonicalPath))<br><br>According to the documentation of realpath() the output buffer needs to be at least of size PATH_MAX specifying output buffers large enough to handle the maximum-size possible result from path manipulation functions. (In that instance, buf's size comes from uv__fs_pathmax_size(). That function attempts to use pathconf(path, _PC_PATH_MAX) as noted in the realpath(3) docs)<br><br>But over here uv__fs_pathmax_size() nor pathconf(path, _PC_PATH_MAX) is used.<br><br><div>Passing an inadequately-sized output buffer to a path manipulation function can result in a buffer overflow. Such functions include realpath() readlink() PathAppend() and others.</div><div><br></div><div><br></div></div>