[haiku-commits] haiku: hrev53265 - src/kits/interface

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 16 Jul 2019 16:36:04 -0400 (EDT)

hrev53265 adds 1 changeset to branch 'master'
old head: 11cba1646d861ee284cc5ec9972cd6429051bb89
new head: 1ec8732c7127ce4a01be35e2b63cc365e516812d
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=1ec8732c7127+%5E11cba1646d86

----------------------------------------------------------------------------

1ec8732c7127: PVS V506: using pointer to deallocated stack space
  
  Change-Id: I43f7d0208f7d644d6f4274a9a718773f7a1346a0
  Reviewed-on: https://review.haiku-os.org/c/1600
  Reviewed-by: Stephan Aßmus <superstippi@xxxxxx>

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53265
Commit:      1ec8732c7127ce4a01be35e2b63cc365e516812d
URL:         https://git.haiku-os.org/haiku/commit/?id=1ec8732c7127
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Tue Jul 16 16:09:47 2019 UTC
Committer:   Stephan Aßmus <superstippi@xxxxxx>
Commit-Date: Tue Jul 16 20:35:56 2019 UTC

----------------------------------------------------------------------------

1 file changed, 4 insertions(+), 1 deletion(-)
src/kits/interface/TextView.cpp | 5 ++++-

----------------------------------------------------------------------------

diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp
index 5e70ff46c1..396515e726 100644
--- a/src/kits/interface/TextView.cpp
+++ b/src/kits/interface/TextView.cpp
@@ -5676,9 +5676,12 @@ void
 BTextView::_ApplyStyleRange(int32 fromOffset, int32 toOffset, uint32 mode,
        const BFont* font, const rgb_color* color, bool syncNullStyle)
 {
+       BFont normalized;
+               // Declared before the if so it stays allocated until the call 
to
+               // SetStyleRange
        if (font != NULL) {
                // if a font has been given, normalize it
-               BFont normalized = *font;
+               normalized = *font;
                _NormalizeFont(&normalized);
                font = &normalized;
        }


Other related posts:

  • » [haiku-commits] haiku: hrev53265 - src/kits/interface - Stephan Aßmus