Skip to content

Instantly share code, notes, and snippets.

View GarrettAlbright's full-sized avatar

Garrett Albright GarrettAlbright

View GitHub Profile
@GarrettAlbright
GarrettAlbright / gist:8626176
Created January 26, 2014 00:42
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>'
diff --git a/src/serialize.h b/src/serialize.h
index 6e952fa..3acdbc0 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -808,19 +808,6 @@ public:
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
- void insert(iterator it, const_iterator first, const_iterator last)
- {