diff options
author | Simon Rettberg | 2015-12-10 15:27:36 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-12-10 15:27:36 +0100 |
commit | 0f6922fac267f4eabe2829529162b28ea464e952 (patch) | |
tree | 6cf8f2084dbf0840d17858ef00152908899bee0c /src/fuse | |
parent | [SERVER] Remove redundant range check (diff) | |
download | dnbd3-0f6922fac267f4eabe2829529162b28ea464e952.tar.gz dnbd3-0f6922fac267f4eabe2829529162b28ea464e952.tar.xz dnbd3-0f6922fac267f4eabe2829529162b28ea464e952.zip |
[FUSE] Fix stack overflow caused by stats data
Diffstat (limited to 'src/fuse')
-rw-r--r-- | src/fuse/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fuse/main.c b/src/fuse/main.c index 4f8f857..eb4566a 100644 --- a/src/fuse/main.c +++ b/src/fuse/main.c @@ -318,9 +318,11 @@ int main(int argc, char *argv[]) logInfo.receivedBytes = 0; logInfo.imageSize = imageSize; logInfo.imageBlockCount = ( imageSize + 4095 ) / 4096; - uint8_t tmpShrt[logInfo.imageBlockCount]; - memset( tmpShrt, 0, sizeof tmpShrt ); - logInfo.blockRequestCount = tmpShrt; + if ( useDebug ) { + logInfo.blockRequestCount = calloc( logInfo.imageBlockCount, sizeof(uint8_t) ); + } else { + logInfo.blockRequestCount = NULL; + } // Since dnbd3 is always read only and the remote image will not change newArgv[newArgc++] = "-o"; |