rugged
rugged copied to clipboard
credentials callback not returning credentials causes a segmentation fault
require 'rugged'
def credentials
lambda do |_, _, _|
return nil
end
end
Rugged::Repository.clone_at 'https://github.com/example/my-project.git', 'my-project' , { credentials: credentials }
Calling clone_at with a credentials callback that returns nil against a repository that requires authentication causes a segmentation fault. When on_headers_complete tries to dereference t->cred->credtype (http.c:379) and t->cred is empty the segfault is triggered.