Bug 2574

Summary: Statement might be overflowing a buffer in strncat.
Product: Claws Mail (GTK 2) Reporter: Malcolm Lewis <malcolmlewis>
Component: UI/Address BookAssignee: users
Status: RESOLVED FIXED    
Severity: major    
Priority: P3    
Version: 3.8.0   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
claws-mail-fix-bufferoverflowstrncat.patch none

Description Malcolm Lewis 2012-01-02 06:54:18 UTC
Created attachment 1057 [details]
claws-mail-fix-bufferoverflowstrncat.patch

Hi
When building claws-mail 3.8.0 on the Open Build Service (https://build.opensuse.org/) I receive the following errors and am
unable to finish the building;

======================================================================
I: Statement might be overflowing a buffer in strncat. Common mistake:
   BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the
   left over size as 3rd argument
   GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
E: claws-mail bufferoverflowstrncat addrbook.c:1849:10
E: claws-mail bufferoverflowstrncat exportldif.c:234:12
E: claws-mail bufferoverflowstrncat exportldif.c:238:13
E: claws-mail bufferoverflowstrncat exportldif.c:243:13
E: claws-mail bufferoverflowstrncat exportldif.c:250:14
======================================================================

I have attached a patch which fixes the build issue.
Comment 1 users 2012-01-20 23:57:34 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.claws-mail.org/tracker/

2012-01-20 [pawel]	3.8.0cvs16

	* src/addrbook.c
	* src/exportldif.c
		Fix bug #2574 'Statement might be overflowing a
		buffer in strncat'