Overview
Comment: | Better overflow checking. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2aaab788cc7ddcb0eb1e552dff6e1c31 |
User & Date: | js on 2008-10-28 19:00:54 |
Other Links: | manifest | tags |
Context
2008-10-29
| ||
16:37 | Add OF_NOT_IMPLEMENTED macro. check-in: d6a3d8a5db user: js tags: trunk | |
2008-10-28
| ||
19:00 | Better overflow checking. check-in: 2aaab788cc user: js tags: trunk | |
18:19 | Add #undefs in OFHashes. check-in: 9759533b97 user: js tags: trunk | |
Changes
Modified src/OFFile.m from [2d25231c0e] to [d80678a165].
︙ | ︙ | |||
102 103 104 105 106 107 108 | return ret; } - (uint8_t*)readWithSize: (size_t)size andNItems: (size_t)nitems { | | | | > | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | return ret; } - (uint8_t*)readWithSize: (size_t)size andNItems: (size_t)nitems { size_t memsize; uint8_t *ret; memsize = nitems * size; if (size > SIZE_MAX / nitems) { [[OFOverflowException newWithObject: self] raise]; return NULL; } ret = [self getMemWithSize: memsize]; @try { [self readIntoBuffer: ret withSize: size andNItems: nitems]; } @catch (OFReadFailedException *e) { [self freeMem: ret]; |
︙ | ︙ |