[Intel-gfx] [PATCH v2] drm/i915: silence coverity warning

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 2 12:45:42 UTC 2017


Quoting Lionel Landwerlin (2017-11-02 12:18:27)
> Because dev_priv is 0-ed it's not currently an issue, but since we
> have dev_priv->perf.oa.test_config.uuid size at uuid + 1, we could
> just copy the null character and silence this warning.
> 
> Detected by CoverityScan, CID#369632 ("Buffer not null terminated")
> 
> v2: Use strlcpy instead of strncpy (Chris)
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>

Since test_config.uuid[UUID_STRING_LEN + 1], this looks about as solid a
defence against static analysers as we can make,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list