Skip to content

Commit 05cc04e

Browse files
committed
Fixed CERT VU#238019 (make sure sasl_encode64() always NUL terminates output or returns SASL_BUFOVER)
1 parent 9b19128 commit 05cc04e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2009-04-27 Ken Murchison <[email protected]>
2+
* lib/saslutil.c: Fixed CERT VU#238019 (make sure sasl_encode64()
3+
always NUL terminates output or returns SASL_BUFOVER).
4+
15
2009-04-11 Alexey Melnikov <[email protected]>
26
* plugins/sql.c: Fixed SQLite lookup function.
37
Also fixed SASL PLAIN authenticaion when used with

lib/saslutil.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* saslutil.c
22
* Rob Siemborski
33
* Tim Martin
4-
* $Id: saslutil.c,v 1.48 2009/04/17 06:04:50 mel Exp $
4+
* $Id: saslutil.c,v 1.49 2009/04/27 13:26:27 murch Exp $
55
*/
66
/*
77
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
@@ -137,7 +137,7 @@ int sasl_encode64(const char *_in,
137137
if (outlen) {
138138
*outlen = olen;
139139
}
140-
if (outmax < olen) {
140+
if (outmax <= olen) {
141141
return SASL_BUFOVER;
142142
}
143143

@@ -162,9 +162,7 @@ int sasl_encode64(const char *_in,
162162
*out++ = '=';
163163
}
164164

165-
if (olen < outmax) {
166-
*out = '\0';
167-
}
165+
*out = '\0';
168166

169167
return SASL_OK;
170168
}

0 commit comments

Comments
 (0)