[Spice-devel] [PATCH] Cap logging level to the valid bounds
Christophe Fergeau
cfergeau at redhat.com
Fri Mar 11 08:57:58 UTC 2016
Hey,
Yep, thanks for sending it. For what it's worth, git commit has a
--author option ;)
Christophe
On Thu, Mar 10, 2016 at 04:29:39PM +0000, Frediano Ziglio wrote:
> Avoid overflows using its values.
> The patch was originally written by Christophe Fergeau
> ---
> common/log.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/common/log.c b/common/log.c
> index a9bbebc..8d47cb6 100644
> --- a/common/log.c
> +++ b/common/log.c
> @@ -50,7 +50,8 @@ static GLogLevelFlags spice_log_level_to_glib(SpiceLogLevel level)
> [ SPICE_LOG_LEVEL_INFO ] = G_LOG_LEVEL_INFO,
> [ SPICE_LOG_LEVEL_DEBUG ] = G_LOG_LEVEL_DEBUG,
> };
> - g_return_val_if_fail ((level >= 0) || (level < G_N_ELEMENTS(glib_levels)), 0);
> + g_return_val_if_fail (level >= 0, G_LOG_LEVEL_ERROR);
> + g_return_val_if_fail (level < G_N_ELEMENTS(glib_levels), G_LOG_LEVEL_DEBUG);
>
> return glib_levels[level];
> }
> --
> 2.5.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160311/c2f7096f/attachment.sig>
More information about the Spice-devel
mailing list