[Mesa-dev] [PATCH] swr/rast: do not crash on NULL strings returned by getenv

Laurent Carlier lordheavym at gmail.com
Mon Sep 18 11:03:14 UTC 2017


Le lundi 18 septembre 2017, 12:48:45 CEST Eric Engestrom a écrit :
> On Monday, 2017-09-18 11:29:21 +0100, Emil Velikov wrote:
> > From: Bernhard Rosenkraenzer <bero at lindev.ch>
> > 
> > The current convinince function GetEnv feeds the results of getenv
> > directly into std::string(). That is a bad idea, since the variable
> > may be unset, thus we feed NULL into the C++ construct.
> > 
> > The latter of which is not allowed and leads to a crash.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101832
> > Fixes: a25093de718 ("swr/rast: Implement JIT shader caching to disk")
> > Cc: Tim Rowley <timothy.o.rowley at intel.com>
> > Cc: Laurent Carlier <lordheavym at gmail.com>
> > Cc: Bernhard Rosenkraenzer <bero at lindev.ch>
> > [Emil Velikov: make an actual commit from the misc diff]
> > Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> 
> Laurent just sent this to the ML an hour before you, but this commit
> message is much better.
> 
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
> 

Yes, really better

Reviewed-by: Laurent Carlier <lordheavym at gmail.com>
-- 
Laurent Carlier
http://www.archlinux.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170918/598d11dc/attachment.sig>


More information about the mesa-dev mailing list