FAQ

svn commit: r885568 - /lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c

Marvin
Nov 30, 2009 at 7:52 pm
Author: marvin
Date: Mon Nov 30 19:52:26 2009
New Revision: 885568

URL: http://svn.apache.org/viewvc?rev=885568&view=rev
Log:
Fix inadequate memory allocation in Charmonizer/Core/HeadCheck.c.

Modified:
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c?rev=885568&r1=885567&r2=885568&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c Mon Nov 30 19:52:26 2009
@@ -152,7 +152,8 @@
S_discover_header(const char *header_name)
{
Header* header = (Header*)malloc(sizeof(Header));
- char *include_test = malloc(strlen(header_name) + 30);
+ size_t needed = strlen(header_name) + sizeof(test_code) + 50;
+ char *include_test = (char*)malloc(needed);

/* assign */
header->name = strdup(header_name);
reply

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post

1 user in discussion

Marvin: 1 post