From fb0872e40be6cc9c04efdb61dea91e914b02b529 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 19 Dec 2014 16:48:36 +0600 Subject: ZVISION: Fix uninitialized scalar field (CID 1257076) --- engines/zvision/scripting/controls/slot_control.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/zvision/scripting/controls/slot_control.cpp') diff --git a/engines/zvision/scripting/controls/slot_control.cpp b/engines/zvision/scripting/controls/slot_control.cpp index 292a2b4bc9..5228ba517b 100644 --- a/engines/zvision/scripting/controls/slot_control.cpp +++ b/engines/zvision/scripting/controls/slot_control.cpp @@ -34,7 +34,9 @@ namespace ZVision { SlotControl::SlotControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream) - : Control(engine, key, CONTROL_SLOT) { + : Control(engine, key, CONTROL_SLOT), + _cursor(CursorIndex_Active), + _distanceId('0') { _renderedItem = 0; _bkg = NULL; -- cgit v1.2.3 From fafbd425dc9f85e524a8222facdb0067632add84 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 19 Dec 2014 17:18:11 +0600 Subject: ZVISION: Fix copy into fixed size buffer (CID 1257095) --- engines/zvision/scripting/controls/slot_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/scripting/controls/slot_control.cpp') diff --git a/engines/zvision/scripting/controls/slot_control.cpp b/engines/zvision/scripting/controls/slot_control.cpp index 5228ba517b..42b54a9ab5 100644 --- a/engines/zvision/scripting/controls/slot_control.cpp +++ b/engines/zvision/scripting/controls/slot_control.cpp @@ -76,7 +76,7 @@ SlotControl::SlotControl(ZVision *engine, uint32 key, Common::SeekableReadStream } else if (param.matchString("eligible_objects", true)) { char buf[256]; memset(buf, 0, 256); - strcpy(buf, values.c_str()); + strncpy(buf, values.c_str(), 255); char *curpos = buf; char *strend = buf + strlen(buf); -- cgit v1.2.3