Permalink
Browse files

Fix segfault which occurs when running some tests

  • Loading branch information...
1 parent c522385 commit b19f54b923bc1cd1a2300313300f7e6587a8cc79 @jkeiser jkeiser committed Jan 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 chef/lib/chef/win32/security.rb
View
2 chef/lib/chef/win32/security.rb
@@ -76,7 +76,7 @@ def self.add_access_denied_ace_ex(acl, sid, access_mask, flags = 0, revision = A
def self.adjust_token_privileges(token, privileges)
token = token.handle if token.respond_to?(:handle)
old_privileges_size = FFI::Buffer.new(:long).write_long(privileges.size_with_privileges)
- old_privileges = TOKEN_PRIVILEGES.new(FFI::Buffer.new(old_privileges_size.length))
+ old_privileges = TOKEN_PRIVILEGES.new(FFI::Buffer.new(old_privileges_size.read_long))
unless AdjustTokenPrivileges(token.handle, false, privileges, privileges.size_with_privileges, old_privileges, old_privileges_size)
Chef::Win32::Error.raise!
end

0 comments on commit b19f54b

Please sign in to comment.