From: Pierangelo Masarati Date: Wed, 22 Oct 2008 23:37:34 +0000 (+0000) Subject: check for overflows X-Git-Tag: ACLCHECK_0~1200 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=faddae3a0e7cc92dd8190b3b0cec02c9c0941194;p=openldap check for overflows --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 9df56882da..59646f455f 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -4154,8 +4154,8 @@ syncrepl_unparse( syncinfo_t *si, struct berval *bv ) if ( WHATSLEFT <= STRLENOF( " " ATTRSONLYSTR "=\"" "\"" ) ) return; ptr = lutil_strcopy( ptr, " " ATTRSSTR "=\"" ); old = ptr; - /* FIXME: add check for overflow */ ptr = anlist_unparse( si->si_anlist, ptr, WHATSLEFT ); + if ( ptr == NULL ) return; if ( si->si_allattrs ) { if ( WHATSLEFT <= STRLENOF( ",*\"" ) ) return; if ( old != ptr ) *ptr++ = ','; @@ -4171,8 +4171,8 @@ syncrepl_unparse( syncinfo_t *si, struct berval *bv ) if ( si->si_exanlist && !BER_BVISNULL(&si->si_exanlist[0].an_name) ) { if ( WHATSLEFT <= STRLENOF( " " EXATTRSSTR "=" ) ) return; ptr = lutil_strcopy( ptr, " " EXATTRSSTR "=" ); - /* FIXME: add check for overflow */ ptr = anlist_unparse( si->si_exanlist, ptr, WHATSLEFT ); + if ( ptr == NULL ) return; } if ( WHATSLEFT <= STRLENOF( " " SCHEMASTR "=" ) + STRLENOF( "off" ) ) return; ptr = lutil_strcopy( ptr, " " SCHEMASTR "=" );