Skip to content

Commit

Permalink
Fixed checking for empty server error message
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Jan 6, 2017
1 parent bd7cdd0 commit 2db5c4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Lib/
*

Modules/
*
* Fixed checking for empty server error message
(thanks to Bradley Baetz)

----------------------------------------------------------------
Released 2.4.28 2016-11-17
Expand Down Expand Up @@ -1307,4 +1308,4 @@ Released 2.0.0pre02 2002-02-01
----------------------------------------------------------------
Released 1.10alpha3 2000-09-19

$Id: CHANGES,v 1.399 2017/01/06 15:07:57 stroeder Exp $
$Id: CHANGES,v 1.400 2017/01/06 15:11:14 stroeder Exp $
4 changes: 2 additions & 2 deletions Modules/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* errors that arise from ldap use
* Most errors become their own exception
* See http://www.python-ldap.org/ for details.
* $Id: errors.c,v 1.25 2015/06/23 09:45:09 stroeder Exp $ */
* $Id: errors.c,v 1.26 2017/01/06 15:11:14 stroeder Exp $ */

#include "common.h"
#include "errors.h"
Expand Down Expand Up @@ -98,7 +98,7 @@ LDAPerror( LDAP *l, char *msg )
Py_XDECREF(str);
} else if (ldap_get_option(l, LDAP_OPT_ERROR_STRING, &error) >= 0
&& error != NULL) {
if (error != '\0') {
if (*error != '\0') {
str = PyString_FromString(error);
if (str)
PyDict_SetItemString( info, "info", str );
Expand Down

0 comments on commit 2db5c4c

Please sign in to comment.