[Bf-blender-cvs] [76c97aaff94] master: Fix T50775: Missing parenthesis on fluid bake button.

Bastien Montagne noreply at git.blender.org
Tue May 30 09:49:53 CEST 2017


Commit: 76c97aaff94c199573463256a2ed7ff8d3d56dde
Author: Bastien Montagne
Date:   Tue May 30 09:46:53 2017 +0200
Branches: master
https://developer.blender.org/rB76c97aaff94c199573463256a2ed7ff8d3d56dde

Fix T50775: Missing parenthesis on fluid bake button.

Yep, that got reported... Was slightly more involved than UI message
fixing though: RNA string length getter shall return exact lentgh of
string (same as strlen), not size of allocated buffer to contain it!
Otherwise, NULL final char leaks in and...

===================================================================

M	source/blender/makesrna/intern/rna_fluidsim.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index 091950a8e66..078b61ad7df 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -185,12 +185,15 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
 #endif
 }
 
-static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr))
+static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr)
 {
 #ifndef WITH_MOD_FLUID
 	return 0;
 #else
-	return 31;
+	char value[32];
+
+	rna_DomainFluidSettings_memory_estimate_get(ptr, value);
+	return strlen(value);
 #endif
 }




More information about the Bf-blender-cvs mailing list