Page MenuHomePhabricator

Fix undefined behavior in rpc/server.cpp
ClosedPublic

Authored by jasonbcox on Mar 1 2019, 00:55.

Details

Reviewers
deadalnix
Fabien
Group Reviewers
Restricted Project
Commits
rABCed234bd3bb18: Fix undefined behavior in rpc/server.cpp
Summary

Calling std::move() on command while dereferencing GetName() is undefined.

Test Plan

ninja check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jasonbcox created this revision.Mar 1 2019, 00:55
Herald added a reviewer: Restricted Project. · View Herald TranscriptMar 1 2019, 00:55
Herald added a subscriber: schancel. · View Herald Transcript
Fabien accepted this revision.Mar 1 2019, 07:14
This revision is now accepted and ready to land.Mar 1 2019, 07:14
deadalnix requested changes to this revision.Mar 1 2019, 13:59
deadalnix added inline comments.
src/rpc/server.cpp
71 ↗(On Diff #7547)

You are introducing a copy here for no good reason.

This revision now requires changes to proceed.Mar 1 2019, 13:59
jasonbcox updated this revision to Diff 7562.Mar 1 2019, 22:33

Fix unnecessary copy

deadalnix accepted this revision.Mar 2 2019, 00:44
This revision is now accepted and ready to land.Mar 2 2019, 00:44
This revision was automatically updated to reflect the committed changes.