libgit2 / libgit2/libgit2sharp

Passing null to Repository.Discover(...) causes AccessViolationException / process termination

オープン
#1,592 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

Reproduction steps
  1. Pass null to Repository.Discover(...)
Expected behavior

A friendly exception. 😉

Actual behavior
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at LibGit2Sharp.Core.NativeMethods.git_repository_discover(LibGit2Sharp.Core.Handles.GitBuf, LibGit2Sharp.Core.FilePath, Boolean, LibGit2Sharp.Core.FilePath)
   at LibGit2Sharp.Core.Proxy+<>c__DisplayClass3e.<git_repository_discover>b__3d(LibGit2Sharp.Core.Handles.GitBuf)
   at LibGit2Sharp.Core.Proxy.ConvertPath(System.Func`2<LibGit2Sharp.Core.Handles.GitBuf,Int32>)
   at LibGit2Sharp.Core.Proxy.git_repository_discover(LibGit2Sharp.Core.FilePath)
   at LibGit2Sharp.Repository.Discover(System.String)
   at GitHub.Services.GitService.GetRepository(System.String)
Version of LibGit2Sharp (release number or SHA1)

0.23.1.0

Operating system(s) tested; .NET runtime tested

Windows 10 + .NET v4.0.30319

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

失敗しているエントリポイントは Repository.Discover(String) で、スタックトレースでは Core.Proxy.git_repository_discover と NativeMethods.git_repository_discover に到達しています。まずそこから、null のパスがネイティブ呼び出しにどのように渡されるかを追跡し、その後リグレッションテストを追加して、null によってプロセスが終了するのではなくマネージ例外が発生することを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, git
領域
api, backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。