zero the permission structure before parsing

should fix #652
This commit is contained in:
Thomas Bernard 2023-04-05 16:03:13 +02:00
parent e439318cf7
commit 5ca1a82f7f
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF

View File

@ -1,7 +1,7 @@
/* $Id: upnppermissions.c,v 1.20 2020/10/30 21:37:35 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
* (c) 2006-2022 Thomas Bernard
* (c) 2006-2023 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
@ -176,6 +176,9 @@ read_permission_line(struct upnpperm * perm,
int n_bits;
int i;
/* zero memory : see https://github.com/miniupnp/miniupnp/issues/652 */
memset(perm, 0, sizeof(struct upnpperm));
/* first token: (allow|deny) */
while(isspace(*p))
p++;