Merge pull request #2718 from mithrandi/bogus-test-allocation-2711

Actually allocate a buffer that is the correct size.