b-980420

ldmud-3.2.9/src/done/b-980420 · 483 B

From the archive ldmud-329.tar.gz

Download the archive   « Back to the archive contents

Short: sprintf() on big floats crashes the driver
Date: 980420
Type: Bug
State: Fixed

The following code causes a segmentation fault by a buffer overrun:

void test() {
 sprintf("%.5f",
99999999129532841420853412051438322515563209673591926319148179520720936003174400.00000 *
99999999129532841420853412051438322515563209673591926319148179520720936003174400.00000 );
}

Solution:
Increased the temporary buffer for float preparation in sprintf() and added
a sanity test just in case.

Site Stats

Snippets: 1791
Codebases: 571