Skip to content
Commit 52844c83 authored by Dimitry Andric's avatar Dimitry Andric
Browse files

Ensure showbase does not overflow do_put buffers

Summary:
In https://bugs.freebsd.org/207918, Daniel McRobb describes how using
std::showbase with ostreams can cause truncation of unsigned long long
when output format is octal.  In fact, this can even happen with
unsigned int and unsigned long.

To ensure this does not happen, add one additional character to the
do_put buffers if std::showbase is on.  Also add a test case.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: cfe-commits, emaste

Differential Revision: https://reviews.llvm.org/D32670

llvm-svn: 302362
parent 33f7397c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment