[fossology/fossology] 7ee6b5: fix(mimetype): Fix usage of strncpy, remove memset


Gaurav Mishra <noreply@...>
 

Branch: refs/heads/master
Home: https://github.com/fossology/fossology
Commit: 7ee6b59552820156cca1ea1fbd705b8c39ca7170
https://github.com/fossology/fossology/commit/7ee6b59552820156cca1ea1fbd705b8c39ca7170
Author: Andreas J. Reichel <andreas.reichel@...>
Date: 2019-08-13 (Tue, 13 Aug 2019)

Changed paths:
M src/mimetype/agent/mimetype.c

Log Message:
-----------
fix(mimetype): Fix usage of strncpy, remove memset

strncpy copies n bytes. If no 0 is within n bytes, the destination
is missing the termination. Add it and only copy BUFFSIZE-1 bytes.

Also, strncpy fills the remaining space with 0, so no memset is
needed.

Signed-off-by: Andreas J. Reichel <andreas.reichel@...>


Commit: 0cc73be5634cbd1eb510f110ed5717a4fcd1e814
https://github.com/fossology/fossology/commit/0cc73be5634cbd1eb510f110ed5717a4fcd1e814
Author: Gaurav Mishra <@gmishx>
Date: 2019-09-19 (Thu, 19 Sep 2019)

Changed paths:
M src/mimetype/agent/mimetype.c

Log Message:
-----------
Merge pull request #1435 from andi8086/andreas/gcc8-mimetype

fix(mimetype): Fix usage of strncpy, remove memset


Compare: https://github.com/fossology/fossology/compare/91e04ad92a07...0cc73be5634c

Join fossology-commits@lists.fossology.org to automatically receive all group messages.