coverity: protect against buffer overflow

Change-Id: Ibf56341b2e52d341ba06708c232947db5191a486
This commit is contained in:
David Tardon
2012-07-03 11:24:38 +02:00
parent 2d58399e50
commit ac45c9867a

View File

@@ -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) ||