diff options
author | Tommi Virtanen <tommi.virtanen@dreamhost.com> | 2011-02-02 14:39:32 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-03-15 12:14:02 -0400 |
commit | b09734b1f4abd86e046777f0f268215b4ef1b523 (patch) | |
tree | 991e7a2d61dc8c950dbbe6082cbb10dfc3786e75 /net/ceph | |
parent | 521cb40b0c44418a4fd36dc633f575813d59a43d (diff) |
libceph: Fix base64-decoding when input ends in newline.
It used to return -EINVAL because it thought the end was not aligned
to 4 bytes.
Clean up superfluous src < end test in if, the while itself guarantees
that.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/armor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ceph/armor.c b/net/ceph/armor.c index eb2a666b0be7..1fc1ee11dfa2 100644 --- a/net/ceph/armor.c +++ b/net/ceph/armor.c | |||
@@ -78,8 +78,10 @@ int ceph_unarmor(char *dst, const char *src, const char *end) | |||
78 | while (src < end) { | 78 | while (src < end) { |
79 | int a, b, c, d; | 79 | int a, b, c, d; |
80 | 80 | ||
81 | if (src < end && src[0] == '\n') | 81 | if (src[0] == '\n') { |
82 | src++; | 82 | src++; |
83 | continue; | ||
84 | } | ||
83 | if (src + 4 > end) | 85 | if (src + 4 > end) |
84 | return -EINVAL; | 86 | return -EINVAL; |
85 | a = decode_bits(src[0]); | 87 | a = decode_bits(src[0]); |