boostorg / boostorg/mysql

Remove UB regarding connection state for async functions in any_connections

Open
#367 0 comments 0 reactions 0 assignees View on GitHub
enhancement security
Dominant language
C++
Stars
299
Forks
43
PR merge metrics
No merged PRs in 30d

Description

We currently have a surprisingly big number of places where initiating an async operation derives in unpredictable and/or undefined behavior, . Since the introduction of any_connection, which does not expose the stream, all of these can be fixed to fail in a predictable way, without overhead. These are:

- Initiating any async op while another op is outstanding.
- Initiating any op after a previous op failed with a fatal error.
- Initiating any op after a multi-function operation is initiated but not logically completed.
- We can probably improve diagnostics when trying to use an unconnected connection.

A simple state machine in any_connection should suffice.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.