[Spice-devel] [PATCH libcacard 1/2] nss: report error on invalid db= argument

Christophe Fergeau cfergeau at redhat.com
Thu Mar 3 09:00:46 UTC 2016


ACK series.

On Thu, Mar 03, 2016 at 01:58:16AM +0100, Marc-André Lureau wrote:
> The db argument must end with " or \n.
> 
> Found thanks to clang scan-build.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> Reported-by: Miroslav Rezanina <mrezanin at redhat.com>
> ---
>  src/vcard_emul_nss.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c
> index 08a60c6..156a916 100644
> --- a/src/vcard_emul_nss.c
> +++ b/src/vcard_emul_nss.c
> @@ -1266,6 +1266,10 @@ vcard_emul_options(const char *args)
>              args++;
>              db = args;
>              args = strpbrk(args, "\"\n");
> +            if (args == NULL) {
> +              fprintf(stderr, "Error: invalid db argument.\n");
> +              return NULL;
> +            }
>              opts->nss_db = g_strndup(db, args-db);
>              if (*args != 0) {
>                  args++;
> -- 
> 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/20160303/828616c0/attachment.sig>


More information about the Spice-devel mailing list