From ac45c9867a7ccd6f4df9c981b617249c6537b86f Mon Sep 17 00:00:00 2001 From: David Tardon Date: Tue, 3 Jul 2012 11:24:38 +0200 Subject: [PATCH] coverity: protect against buffer overflow Change-Id: Ibf56341b2e52d341ba06708c232947db5191a486 --- extensions/source/nsplugin/source/so_env.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/source/nsplugin/source/so_env.cxx b/extensions/source/nsplugin/source/so_env.cxx index 37d8ee3934d2..a04b873b363a 100644 --- a/extensions/source/nsplugin/source/so_env.cxx +++ b/extensions/source/nsplugin/source/so_env.cxx @@ -431,7 +431,8 @@ char* NSP_getProductName() (NULL == (pEnd = strchr( pStart, '\r' )))) continue; *pEnd = 0; - strcpy(productName, pStart); + if (static_cast(pEnd - pStart) <= sizeof(productName)) + strcpy(productName, pStart); } fclose(fp); if ((*productName == 0) ||