Actions
Bug #6697
closedstrncmp(3) must not be used on binary data
% Done:
80%
Source:
other
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
strncmp(3) is intended to compare C strings, so it quits comparing after encountering a null character. The Linux man page is ambiguous on this point, but section 4.11.4.4 of the ANSI C standard is clear. Ceph mostly uses strncmp correctly, but uses it on binary data in these places:
msg/msg_types.h:30, 33
test_librbd.cc:861, 847, 861
TestErasureCodeJerasure.cc:70, 71, 85, 86, 104, 105 (I'm not sure whether these are guaranteed to be C Strings or not)
Updated by Loïc Dachary over 9 years ago
- Status changed from New to 12
- Assignee set to Loïc Dachary
Updated by Loïc Dachary over 9 years ago
- Status changed from 12 to Fix Under Review
- % Done changed from 0 to 80
Updated by Loïc Dachary over 9 years ago
- Status changed from Fix Under Review to Resolved
Actions