From 816e68f94fe500b9d68fd29021d432b84d3139b7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 14 Sep 2013 13:43:03 +0200 Subject: libndr: Fix ndr_print_bitmap_flag for value=0 Don't endlessly loop Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- librpc/ndr/ndr_basic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c index 35b223da7a..113745ce97 100644 --- a/librpc/ndr/ndr_basic.c +++ b/librpc/ndr/ndr_basic.c @@ -1020,6 +1020,10 @@ _PUBLIC_ void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const ch /* this is an attempt to support multi-bit bitmap masks */ value &= flag; + if (value == 0) { + return; + } + while (!(flag & 1)) { flag >>= 1; value >>= 1; -- cgit