Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • G go
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • go
  • Repository
  • go
  • src
  • encoding
  • json
  • encode.go
Find file BlameHistoryPermalink
  • William Poussier's avatar
    encoding/json: fix panic for nil instances of TextMarshaler in map keys · 85f3ca74
    William Poussier authored Sep 01, 2019
    This change adds a a check in the encodeWithString.resolve method
    to ensure that a reflect.Value with kind Ptr is not nil before
    the type assertion to TextMarshaler.
    
    If the value is nil, the method returns a nil error, and the map key
    encodes to an empty string.
    
    Fixes #33675
    
    Change-Id: I0a04cf690ae67006f6a9c5f8cbb4cc99d236bca8
    GitHub-Last-Rev: 6c987c90846f854e21814dbfb3a073605ec8a94c
    GitHub-Pull-Request: golang/go#33700
    Reviewed-on: https://go-review.googlesource.com/c/go/+/190697
    
    
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
    85f3ca74
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7