fix: break potential infinite loop in tfsMkdirRecurAt
This commit is contained in:
parent
4a287aa8bc
commit
0b077a89a7
|
@ -296,7 +296,7 @@ int32_t tfsMkdirRecurAt(STfs *pTfs, const char *rname, SDiskID diskId) {
|
|||
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dirname.3.html
|
||||
char *dir = taosStrdup(taosDirName(s));
|
||||
|
||||
if (tfsMkdirRecurAt(pTfs, dir, diskId) < 0) {
|
||||
if (strlen(dir) >= strlen(rname) || tfsMkdirRecurAt(pTfs, dir, diskId) < 0) {
|
||||
taosMemoryFree(s);
|
||||
taosMemoryFree(dir);
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue