{"record":{"id":"69214e6dc2529df8","repo":"ruby/rubygems","slug":"tar-is-corrupt-name-contains-null-byte","errorCode":null,"errorMessage":"tar is corrupt, name contains null byte","messagePattern":"tar is corrupt, name contains null byte","errorType":"exception","errorClass":"Gem::Package::TarInvalidError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/package/tar_reader/entry.rb","lineNumber":93,"sourceCode":"  end\n\n  ##\n  # Are we at the end of the tar entry?\n\n  def eof?\n    check_closed\n\n    @read >= @header.size\n  end\n\n  ##\n  # Full name of the tar entry\n\n  def full_name\n    @header.full_name.force_encoding(Encoding::UTF_8)\n  rescue ArgumentError => e\n    raise unless e.message == \"string contains null byte\"\n    raise Gem::Package::TarInvalidError,\n          \"tar is corrupt, name contains null byte\"\n  end\n\n  ##\n  # Read one byte from the tar entry\n\n  def getc\n    return nil if eof?\n\n    ret = @io.getc\n    @read += 1 if ret\n\n    ret\n  end\n\n  ##\n  # Is this tar entry a directory?\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/package/tar_reader/entry.rb#L75-L111","documentation":"Error \"tar is corrupt, name contains null byte\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/package/tar_reader/entry.rb:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The tar archive is corrupt (entry name contains a null byte); re-download the gem and do not install the tampered file"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}