We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eea29da commit f9ed625Copy full SHA for f9ed625
1 file changed
src/muxer/bbfmux.cpp
@@ -60,6 +60,7 @@ char* readTxtFile(const char* fPath)
60
if(!file)
61
{
62
// can't open file
63
+ printf("[BBFMUX] Unable to read text file: %s", fPath);
64
return 0;
65
}
66
@@ -68,7 +69,14 @@ char* readTxtFile(const char* fPath)
68
69
fseek(file, 0, SEEK_SET);
70
71
char* cString = (char*)malloc(fileSize + 1);
- fread(cString, 1, fileSize, file);
72
+ size_t readSize = fread(cString, 1, fileSize, file);
73
+
74
+ if (readSize != fileSize)
75
+ {
76
77
+ return 0;
78
+ }
79
80
fclose(file);
81
82
cString[fileSize] = 0;
0 commit comments