[Mesa-dev] [PATCH] clover: fix tgsi compiler crash with invalid src

Francisco Jerez currojerez at riseup.net
Mon Oct 26 08:56:00 PDT 2015


Serge Martin <edb+mesa at sigluy.net> writes:

> ---
>  src/gallium/state_trackers/clover/tgsi/compiler.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/tgsi/compiler.cpp b/src/gallium/state_trackers/clover/tgsi/compiler.cpp
> index 54cb747..4d05666 100644
> --- a/src/gallium/state_trackers/clover/tgsi/compiler.cpp
> +++ b/src/gallium/state_trackers/clover/tgsi/compiler.cpp
> @@ -97,6 +97,11 @@ namespace {
>  module
>  clover::compile_program_tgsi(const std::string &source, std::string &r_log) {
>     const size_t body_pos = source.find("COMP\n");
> +   if (body_pos == std::string::npos) {
> +      r_log = "invalid source";
> +      throw compile_error();
> +   }
> +
>     const char *body = &source[body_pos];
>     module m;

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

>  
> -- 
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151026/430ded18/attachment.sig>


More information about the mesa-dev mailing list