[haiku-commits] r37476 - haiku/trunk/src/kits/tracker

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 12 Jul 2010 04:06:29 +0200 (CEST)

Author: anevilyak
Date: 2010-07-12 04:06:29 +0200 (Mon, 12 Jul 2010)
New Revision: 37476
Changeset: http://dev.haiku-os.org/changeset/37476/haiku

Modified:
   haiku/trunk/src/kits/tracker/FSUtils.h
Log:
WellKnownEntry used a const char * to store the name of its entry, but didn't 
actually copy the passed-in string, only its pointer. Since the entries were 
all populated via strings off the stack, this led to them being overwritten 
with random garbage during program execution. In the best case, this would 
result in well known icons such as the ladybug boot volume failing to resolve. 
In the worst case, this likely led to random corruption/crashes. Fixed by 
having them store a BString instead.



Modified: haiku/trunk/src/kits/tracker/FSUtils.h
===================================================================
--- haiku/trunk/src/kits/tracker/FSUtils.h      2010-07-11 20:51:57 UTC (rev 
37475)
+++ haiku/trunk/src/kits/tracker/FSUtils.h      2010-07-12 02:06:29 UTC (rev 
37476)
@@ -296,7 +296,7 @@
 
                        node_ref node;
                        directory_which which;
-                       const char *name;
+                       BString name;
                };
 
                static directory_which Match(const node_ref *);


Other related posts:

  • » [haiku-commits] r37476 - haiku/trunk/src/kits/tracker - anevilyak