diff options
author | David Tardon <dtardon@redhat.com> | 2012-07-03 11:24:38 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-07-03 17:47:19 +0200 |
commit | ac45c9867a7ccd6f4df9c981b617249c6537b86f (patch) | |
tree | 09addeee8acb6b54a2005ca3abed7a2f6d9d21d5 /extensions | |
parent | 2d58399e50395ed2b045f45986554c9914a696a9 (diff) |
coverity: protect against buffer overflow
Change-Id: Ibf56341b2e52d341ba06708c232947db5191a486
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/nsplugin/source/so_env.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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<size_t>(pEnd - pStart) <= sizeof(productName)) + strcpy(productName, pStart); } fclose(fp); if ((*productName == 0) || |