• Rebecca Stambler's avatar
    strconv: check for empty string in UnquoteChar · b219a68a
    Rebecca Stambler authored
    The existing implementation panics on malformed input of an empty
    string. strconv.Unquote validates the length of the inputs, but calling
    UnquoteChar directly with an empty string leads to a panic, so add a
    check for length. Also, add a test to go/constant to ensure that
    MakeFromLiteral does not panic on malformed input such as
    "const x = ''".
    
    Change-Id: I4217e38db48a09a21ec414bbfb3087709da62904
    Reviewed-on: https://go-review.googlesource.com/116215
    Run-TryBot: Robert Griesemer <gri@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    b219a68a
Name
Last commit
Last update
..
testdata Loading commit data...
atob.go Loading commit data...
atob_test.go Loading commit data...
atof.go Loading commit data...
atof_test.go Loading commit data...
atoi.go Loading commit data...
atoi_test.go Loading commit data...
decimal.go Loading commit data...
decimal_test.go Loading commit data...
doc.go Loading commit data...
example_test.go Loading commit data...
export_test.go Loading commit data...
extfloat.go Loading commit data...
fp_test.go Loading commit data...
ftoa.go Loading commit data...
ftoa_test.go Loading commit data...
internal_test.go Loading commit data...
isprint.go Loading commit data...
itoa.go Loading commit data...
itoa_test.go Loading commit data...
makeisprint.go Loading commit data...
quote.go Loading commit data...
quote_test.go Loading commit data...
strconv_test.go Loading commit data...