Indigo Rose Software

Go Back   Indigo Rose Software Forums > Setup Factory 8.0 > Setup Factory 8.0 Suggestions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2009
adrien adrien is offline
Indigo Rose Customer
 
Join Date: Nov 2007
Posts: 31
Bug: Integer overflow in Registry GetValue/SetValue

Hi

I've some lua code that I use to copy registry keys in my installer.

I'm finding it's converting any REG_DWORD value of 0xFFFFFFFE to 0x7FFFFFF

everything else copies fine, just these large DWORDs.

My guess is it's converting any value > max signed int to max signed int.

Either that or the set value is incorrectly dealing with sign.

The copy function is as below

Code:
function CopyRegKey(rootkey, source, dest, bDeleteOld)
	-- create target key
	Registry.CreateKey(rootkey, dest);
	-- recursively iterate subkeys
	subkeys = Registry.GetKeyNames(rootkey, source);
	if(subkeys ~= nil) then
		for ind, keyname in pairs(subkeys) do
			CopyRegKey(rootkey, source.."\\"..keyname, dest.."\\"..keyname, bDeleteOld);
		end
	end
	-- copy the values over
	values = Registry.GetValueNames(rootkey, source);
	if(values ~= nil) then
		for ind, valname in pairs(values) do
			-- get data and type from source value
			v = Registry.GetValue(rootkey, source, valname, false);
			t = Registry.GetValueType(rootkey, source, valname);
			-- poke the value into the target key
			Registry.SetValue(rootkey, dest, valname, v, t);
		end
	end

	-- ok, no subkeys or values in this source key, delete it
	if(bDeleteOld== true)then
		Registry.DeleteValue(rootkey, source, "(Default)");
		Registry.DeleteKey(rootkey, source);
	end
end
I've patched around it in my code, but it's an ugly hack. Someone might want to fix this in next SetupFactory or Lua.

Last edited by adrien; 03-24-2009 at 10:10 PM.
Reply With Quote
  #2  
Old 03-25-2009
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Hello,

thank you for the report. This has been entered into our internal bug tracking database.

Reference number: 18425.

Regards,
Ulrich
Reply With Quote
  #3  
Old 03-25-2009
adrien adrien is offline
Indigo Rose Customer
 
Join Date: Nov 2007
Posts: 31
thanks

I had to fix the problem quick, so I wrote an action module for it which I just submitted.

those functions really should be part of Registry.

I can give you source if you like.

Regards

Adrien
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BUG; Registry delete value Solmos AutoPlay Media Studio 7.5 Suggestions 5 03-25-2008 08:58 PM
TrueUpdate 2.0 Update (v2.0.6.0) Released Brett TrueUpdate 2.0 0 10-31-2006 02:10 PM
New Setup Factory 7.0 (v 7.0.2.0) Available Darryl Setup Factory 7.0 Discussion 9 03-06-2005 02:57 PM
AutoPlay Media Studio 4.0.0.3 Released Brett AutoPlay Media Studio 4.0 0 12-11-2002 09:39 AM


All times are GMT -6. The time now is 04:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software