From 28f69b393fd63221894bb3232b0877919854e9ea Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Apr 19 2018 20:00:35 +0000 Subject: Ticket 49639 - Crash when failing to read from SASL conn Description: This is a regression from ticket 49618, a return code integer was reset to a unsigned int, when it needed to remain signed. This allowed an error condition to go unchecked, which leads to a crash caused by a large realloc attempt from the overflowed integer result code. https://pagure.io/389-ds-base/issue/49639 Reviewed by: mreynolds(one line commit rule) --- diff --git a/ldap/servers/slapd/sasl_io.c b/ldap/servers/slapd/sasl_io.c index 751832b..7351148 100644 --- a/ldap/servers/slapd/sasl_io.c +++ b/ldap/servers/slapd/sasl_io.c @@ -189,8 +189,8 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt unsigned char buffer[SASL_IO_BUFFER_START_SIZE]; sasl_io_private *sp = sasl_get_io_private(fd); Connection *c = sp->conn; - uint32_t amount = sizeof(buffer); - uint32_t ret = 0; + int32_t amount = sizeof(buffer); + int32_t ret = 0; uint32_t packet_length = 0; int32_t saslio_limit;