Fix for bug 2823:
authorJaap Keuter <jaap.keuter@xs4all.nl>
Mon, 13 Oct 2008 06:54:19 +0000 (06:54 -0000)
committerJaap Keuter <jaap.keuter@xs4all.nl>
Mon, 13 Oct 2008 06:54:19 +0000 (06:54 -0000)
Do not pass automatic variable back into caller space.

svn path=/trunk/; revision=26425

rawshark.c

index 8f786e8f2932690f5900a614a7a64b6bb3fba950..7c388ba370defa63db106341be0bf5996bdbeadb 100644 (file)
@@ -884,7 +884,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info,
   struct pcap_pkthdr hdr;
   int bytes_read = 0;
   int bytes_needed = sizeof(struct pcap_pkthdr);
-  gchar err_str[1024+1];
+  static gchar err_str[100];
 
   /* Copied from capture_loop.c */
   while (bytes_needed > 0) {
@@ -916,7 +916,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info,
 #endif
   if (bytes_needed > WTAP_MAX_PACKET_SIZE) {
     *err = WTAP_ERR_BAD_RECORD;
-    g_snprintf(err_str, 1024, "Bad packet length: %d (%04x)", bytes_needed, bytes_needed);
+    g_snprintf(err_str, 100, "Bad packet length: %d (%04x)", bytes_needed, bytes_needed);
     *err_info = err_str;
     return FALSE;
   }