From faddae3a0e7cc92dd8190b3b0cec02c9c0941194 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 22 Oct 2008 23:37:34 +0000 Subject: [PATCH] check for overflows --- servers/slapd/syncrepl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 "=" ); -- 2.39.5