Skip to content

Commit

Permalink
clone string to avoid use after free
Browse files Browse the repository at this point in the history
  • Loading branch information
joellubi committed Mar 17, 2024
1 parent d6ae1a5 commit 326c1f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/adbc/driver/flightsql/flightsql_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func (c *connectionImpl) PrepareDriverInfo(ctx context.Context, infoCodes []adbc
// we know we're only doing string fields here right now
v := info.Field(info.ChildID(i)).(*array.String).
Value(int(info.ValueOffset(i)))
if err := driverInfo.RegisterInfoCode(adbcInfoCode, v); err != nil {
if err := driverInfo.RegisterInfoCode(adbcInfoCode, strings.Clone(v)); err != nil {
return err
}
}
Expand Down

0 comments on commit 326c1f7

Please sign in to comment.