Skip to content

Instantly share code, notes, and snippets.

@GarrettAlbright
Created January 26, 2014 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GarrettAlbright/8626176 to your computer and use it in GitHub Desktop.
Save GarrettAlbright/8626176 to your computer and use it in GitHub Desktop.
Null byte in shell command
commit_header = "commit #{length}\000" + body
# ...
puts 'Success'
# `git hash-object -t commit --stdin -w "#{commit}"`
Process.exec('git hash-object -t commit --stdin -w', commit)
# miner.rb:51:in `exec': string contains null byte (ArgumentError)
# from miner.rb:51:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment