Skip to content

Commit

Permalink
[Truffle] Only expect one null byte before the start of argv.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Dec 14, 2016
1 parent 6ed1d90 commit 6ccbbcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions truffle/src/main/ruby/core/process.rb
Expand Up @@ -161,7 +161,7 @@ def self.setproctitle_linux_from_proc_maps(title)
main_index = command.index("\x00org.jruby")
raise "Did not find the main class in args" unless main_index
needle = command[0...main_index]
i = haystack.index("\x00\x00#{needle}")
i = haystack.index("\x00#{needle}")
unless i
puts
p needle
Expand All @@ -170,7 +170,7 @@ def self.setproctitle_linux_from_proc_maps(title)
puts
raise "argv[0] not found"
end
i += 2
i += 1

@_argv0_max_length = needle.bytesize
base + i
Expand Down

0 comments on commit 6ccbbcd

Please sign in to comment.