[llvm-commits] [test-suite] r57961 - /test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c

Chris Lattner sabre at nondot.org
Tue Oct 21 22:29:55 PDT 2008


Author: lattner
Date: Wed Oct 22 00:29:55 2008
New Revision: 57961

URL: http://llvm.org/viewvc/llvm-project?rev=57961&view=rev
Log:
remove use of uninitialized memory from this program.  This lets it be valgrind
clean.

Modified:
    test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c

Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c?rev=57961&r1=57960&r2=57961&view=diff

==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c Wed Oct 22 00:29:55 2008
@@ -16,6 +16,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include "packet_lengths.h"
 #include "headers.h"
 #include "packet.h"
@@ -56,6 +57,7 @@
     }
 
   /* Copy the header information */
+  memset((void*)packet, 0, packet_length);
   memcpy ((void *)packet, (void *)headers[packet_number], HEADER_SIZE);
 #endif
 





More information about the llvm-commits mailing list