Merge lp:~vanvugt/compiz/fix-1089251 into lp:compiz/0.9.9

Proposed by Daniel van Vugt
Status: Superseded
Proposed branch: lp:~vanvugt/compiz/fix-1089251
Merge into: lp:compiz/0.9.9
Diff against target: 54 lines (+6/-24)
1 file modified
compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp (+6/-24)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1089251
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+139402@code.launchpad.net

This proposal has been superseded by a proposal from 2012-12-12.

Commit message

Fix segfaults in compizconfig_test_ccs_setting, due to a reference pointing
at a temporary. (LP: #1089251)

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp'
--- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2012-12-07 06:01:09 +0000
+++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_setting.cpp 2012-12-12 08:58:21 +0000
@@ -490,16 +490,19 @@
490 typedef CopyRawValueBase <const char *> Parent;490 typedef CopyRawValueBase <const char *> Parent;
491491
492 CopyRawValue (const char * value) :492 CopyRawValue (const char * value) :
493 CopyRawValueBase <const char *> (value)493 CopyRawValueBase <const char *> (ptr),
494 ptr (value)
494 {495 {
495 }496 }
496497
497 ReturnType operator () ()498 ReturnType operator () ()
498 {499 {
499 /* XXX: Valgrind complains here that mValue is uninitialized, but
500 * verification using gdb confirms that isn't true */
501 return strdup (Parent::mValue);500 return strdup (Parent::mValue);
502 }501 }
502
503 private:
504 // mValue is a reference so it needs a persistent variable to point at
505 const char *ptr;
503};506};
504507
505template <>508template <>
@@ -550,27 +553,6 @@
550 return settingValue;553 return settingValue;
551}554}
552555
553CCSSettingValuePtr
554ListValueToSettingValueList (CCSSettingValue *listChild)
555{
556 listChild->isListChild = TRUE;
557
558 CCSSettingValueList valueListHead = ccsSettingValueListAppend (NULL, listChild);
559 CCSSettingValuePtr valueListValue (AutoDestroy (NewCCSSettingValue (),
560 ccsSettingValueUnref));
561
562 valueListValue->value.asList = valueListHead;
563
564 return valueListValue;
565}
566
567template <typename SettingValueType>
568CCSSettingValuePtr
569RawValueToListValue (const SettingValueType &value)
570{
571 return ListValueToSettingValueList (RawValueToCCSValue (value));
572}
573
574class ContainedValueGenerator556class ContainedValueGenerator
575{557{
576 private:558 private:

Subscribers

People subscribed via source and target branches