-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table CRC Tool Fails to Close File Descriptor #1
Comments
I can do this. |
skliper
pushed a commit
that referenced
this issue
Sep 10, 2019
skliper
added a commit
that referenced
this issue
Sep 10, 2019
Reviewed and approved at 2019-09-04 CCB
skliper
added a commit
that referenced
this issue
Sep 10, 2019
Reviewed and approved at 2019-09-04 CCB
Closed
skliper
pushed a commit
that referenced
this issue
Sep 12, 2019
skliper
added a commit
that referenced
this issue
Sep 12, 2019
Reviewed and approved at 2019-09-04 CCB
skliper
added a commit
that referenced
this issue
Sep 12, 2019
skliper
added a commit
that referenced
this issue
Sep 12, 2019
Reviewed and approved at 2019-09-04 CCB
skliper
added a commit
that referenced
this issue
Sep 16, 2019
skliper
added a commit
that referenced
this issue
Oct 1, 2019
Fasttracked to test, reviewed at 2019-09-25 CCB
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Analysis of the 27b VPU FSW code revealed that there is a potential leak of an allocated resource in the file cfe_ts_crc.c. The resource "fd" is opened but never closed before the function returns.
VpuTopProject/cfs/CFE/tools/tblCRCTool/cfe_ts_crc.c
143 /* open the input file if possible /
-->144 fd = open( argv[1], O_RDONLY );
145 if ( fd < 0 )
146 {
147 printf("\ncfe_ts_crc error: can't open input file!\n");
148 exit(0);
149 }
150 / seek past the number of bytes requested /
151 lseek( fd, skipSize, SEEK_SET );
152
153 / read the input file 100 bytes at a time /
154 while ( done == 0 )
155 {
156 readSize = read(fd, buffer, 100);
157 fileCRC = CFE_ES_CalculateCRC(buffer, readSize, fileCRC, CFE_ES_CRC_16);
158 fileSize += readSize;
159 if (readSize != 100) done=1;
160 }
161 / print the size/CRC results */
162 printf("\nTable File Name: %s\nTable Size: %d Bytes\nExpected TS Validation CRC: 0x%08X\n\n", argv[1], fileSize, fileCRC);
163
164 return(fileCRC);
165 }
The text was updated successfully, but these errors were encountered: