From 87c01d0bedabd7241b925c0b96cb15be5b90e804 Mon Sep 17 00:00:00 2001 From: Lynn Stricklan Date: Tue, 5 Jan 2021 14:39:18 -0700 Subject: [PATCH] Update libqb.cpp When opening a file for random access, if the LEN is not supplied, it defaults the length correctly, but does not allocate the buffer correctly. The code should reference the record_length in the file struct. --- internal/c/libqb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index da64aff9e..16a345d0e 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -13037,7 +13037,7 @@ void sub_open(qbs *name,int32 type,int32 access,int32 sharing,int32 i,int64 reco if (type==1){//set record length f->record_length=128; if (passed) if (record_length!=-1) f->record_length=record_length; - f->field_buffer=(uint8*)calloc(record_length,1); + f->field_buffer=(uint8*)calloc(f->record_length,1); } if (type==5){//seek eof