@ @ requires \valid(IN); @ requires (9 == uSectorShift) || (12 == uSectorShift); @ requires \valid( buf + (0 .. (1< \initialized(buf + (0 .. (1<<uSectorShift)-1)); @ assigns *IN, errno; @ assigns *((char *)buf + (0
| 99 | @ assigns Frama_C_entropy_source; |
| 100 | @*/ |
| 101 | static int OLE_read_block(FILE *IN, char *buf, const unsigned int uSectorShift, const unsigned int block, const uint64_t offset) |
| 102 | { |
| 103 | const size_t size=1<<uSectorShift; |
| 104 | /*@ assert size == 1<<uSectorShift; */ |
| 105 | if(block==0xFFFFFFFF || block==0xFFFFFFFE) |
| 106 | return -1; |
| 107 | if(my_fseek(IN, offset + ((uint64_t)(1+block)<<uSectorShift), SEEK_SET) < 0) |
| 108 | { |
| 109 | return -1; |
| 110 | } |
| 111 | if(fread(buf, size, 1, IN)!=1) |
| 112 | { |
| 113 | return -1; |
| 114 | } |
| 115 | #if defined(__FRAMAC__) |
| 116 | Frama_C_make_unknown(buf, size); |
| 117 | #endif |
| 118 | /*@ assert \initialized(buf + (0 .. size-1)); */ |
| 119 | /*@ assert \initialized(buf + (0 .. (1<<uSectorShift)-1)); */ |
| 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | /*@ |
| 124 | @ requires \valid(IN); |
no test coverage detected