ObjFW  Diff

Differences From Artifact [fded94162f]:

To Artifact [49ac97ac70]:

  • File src/OFZIPArchiveEntry.m — part of check-in [be628bbb84] at 2013-11-06 20:58:10 on branch trunk — OFZIPArchive: Do not sort -[entries].

    While sorting -[entries] reduces hard disk seeks, it allows a denial of
    service by creating an archive with a huge central directory without
    actual files. As usually the order in the central directory matches the
    order of the actual files, this minor speed increase is not worth the
    attack vector. (user: js, size: 6241) [annotate] [blame] [check-ins using]


247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
	return _externalAttributes;
}

- (uint64_t)OF_localFileHeaderOffset
{
	return _localFileHeaderOffset;
}

- (of_comparison_result_t)compare: (id)object
{
	OFZIPArchiveEntry *entry;

	if (![object isKindOfClass: [OFZIPArchiveEntry class]])
		@throw [OFInvalidArgumentException exception];

	entry = object;

	if (_localFileHeaderOffset > entry->_localFileHeaderOffset)
		return OF_ORDERED_DESCENDING;
	if (_localFileHeaderOffset < entry->_localFileHeaderOffset)
		return OF_ORDERED_ASCENDING;

	return OF_ORDERED_SAME;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

247
248
249
250
251
252
253

















254
	return _externalAttributes;
}

- (uint64_t)OF_localFileHeaderOffset
{
	return _localFileHeaderOffset;
}

















@end