coverity#1242793 Untrusted value as argument

and

coverity#1242945 Untrusted value as argument

Change-Id: Ie35f7ca0967366a7854bfc26085f84ce7624559f
coverity#1242895 Untrusted loop bound

Change-Id: I057f81785972106b10c8c5a7992b2b1ec1dc145e
Resolves: fdo#86843 avoid getting deleted before finishing Broadcast

Change-Id: I19181f9e2fbd5f906e6e5d807b1b2483e7881cf0