Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

tango_const.h possible seg fault #510

@alexElettra

Description

@alexElettra

In include/tango/tango_const.h there are the defines:

enum CmdArgType {
DEV_VOID = 0,
DEV_BOOLEAN,
DEV_SHORT,
DEV_LONG,
DEV_FLOAT,
DEV_DOUBLE,
DEV_USHORT,
DEV_ULONG,
DEV_STRING,
DEVVAR_CHARARRAY,
DEVVAR_SHORTARRAY,
DEVVAR_LONGARRAY,
DEVVAR_FLOATARRAY,
DEVVAR_DOUBLEARRAY,
DEVVAR_USHORTARRAY,
DEVVAR_ULONGARRAY,
DEVVAR_STRINGARRAY,
DEVVAR_LONGSTRINGARRAY,
DEVVAR_DOUBLESTRINGARRAY,
DEV_STATE,
CONST_DEV_STRING,
DEVVAR_BOOLEANARRAY,
DEV_UCHAR,
DEV_LONG64,
DEV_ULONG64,
DEVVAR_LONG64ARRAY,
DEVVAR_ULONG64ARRAY,
DEV_INT,
DEV_ENCODED,
DEV_ENUM,
DEV_PIPE_BLOB,
DEVVAR_STATEARRAY,
DATA_TYPE_UNKNOWN = 100
};
and:
const char * const CmdArgTypeName[] = {
"DevVoid",
"DevBoolean",
"DevShort",
"DevLong",
"DevFloat",
"DevDouble",
"DevUShort",
"DevULong",
"DevString",
"DevVarCharArray",
"DevVarShortArray",
"DevVarLongArray",
"DevVarFloatArray",
"DevVarDoubleArray",
"DevVarUShortArray",
"DevVarULongArray",
"DevVarStringArray",
"DevVarLongStringArray",
"DevVarDoubleStringArray",
"DevState",
"ConstDevString",
"DevVarBooleanArray",
"DevUChar",
"DevLong64",
"DevULong64",
"DevVarLong64Array",
"DevVarULong64Array",
"DevInt",
"DevEncoded",
"DevEnum",
"DevPipeBlob",
"DevVarStateArray",
"Unknown"
};
BUT doing Tango::CmdArgTypeName[Tango::DATA_TYPE_UNKNOWN] an over bounds access (index = 100) on an array made of 33 elements is done.

CAREFUL in using such a syntax!

Cheers,
Alessandro

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions