Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:steveicarus/iverilog

  • Loading branch information...
commit 9a7155a1faa060e7b4345289e7bda7d7f68386b5 2 parents 860419a + 620b00b
Stephen Williams authored
Showing with 5 additions and 2 deletions.
  1. +2 −1  vpi/cppcheck.sup
  2. +3 −1 vpi/fstapi.c
3  vpi/cppcheck.sup
View
@@ -3,6 +3,7 @@
// problems will not be fixed.
// fstapi.c from GTKWave
+obsoleteFunctionsasctime:fstapi.c:652
variableScope:fstapi.c:1707
variableScope:fstapi.c:1965
variableScope:fstapi.c:2109
@@ -11,7 +12,7 @@ variableScope:fstapi.c:2269
variableScope:fstapi.c:2976
variableScope:fstapi.c:3304
variableScope:fstapi.c:3313
-variableScope:fstapi.c:4980
+variableScope:fstapi.c:4982
// lxt2_write.c from GTKWave
obsoleteFunctionsalloca:lxt2_write.c:1813
4 vpi/fstapi.c
View
@@ -3820,7 +3820,7 @@ for(;;)
uint64_t tpval;
int ti;
- fseeko(xc->f, blkpos + seclen - 24, SEEK_SET);
+ if(fseeko(xc->f, blkpos + seclen - 24, SEEK_SET) != 0) break;
tsec_uclen = fstReaderUint64(xc->f);
tsec_clen = fstReaderUint64(xc->f);
tsec_nitems = fstReaderUint64(xc->f);
@@ -3828,7 +3828,9 @@ for(;;)
printf("\ttime section unc: %d, com: %d (%d items)\n",
(int)tsec_uclen, (int)tsec_clen, (int)tsec_nitems);
#endif
+ if(tsec_clen > seclen) break; /* corrupted tsec_clen: by definition it can't be larger than size of section */
ucdata = malloc(tsec_uclen);
+ if(!ucdata) break; /* malloc fail as tsec_uclen out of range from corrupted file */
destlen = tsec_uclen;
sourcelen = tsec_clen;
Please sign in to comment.
Something went wrong with that request. Please try again.