Commit 179b976f authored by Adrian Knoth's avatar Adrian Knoth Committed by GitHub
Browse files

Merge pull request #208 from gazoo74/valgrind

Valgrind
parents 08571170 fd48059f
...@@ -48,6 +48,7 @@ JackDriver::JackDriver(const char* name, const char* alias, JackLockedEngine* en ...@@ -48,6 +48,7 @@ JackDriver::JackDriver(const char* name, const char* alias, JackLockedEngine* en
fEngine = engine; fEngine = engine;
fGraphManager = NULL; fGraphManager = NULL;
fBeginDateUst = 0; fBeginDateUst = 0;
fEndDateUst = 0;
fDelayedUsecs = 0.f; fDelayedUsecs = 0.f;
fIsMaster = true; fIsMaster = true;
fIsRunning = false; fIsRunning = false;
......
...@@ -163,11 +163,14 @@ struct JackClientCheckRequest : public JackRequest ...@@ -163,11 +163,14 @@ struct JackClientCheckRequest : public JackRequest
int fUUID; int fUUID;
int fOpen; int fOpen;
JackClientCheckRequest() JackClientCheckRequest() : fProtocol(0), fOptions(0), fUUID(0), fOpen(0)
{} {
memset(fName, 0, sizeof(fName));
}
JackClientCheckRequest(const char* name, int protocol, int options, int uuid, int open = false) JackClientCheckRequest(const char* name, int protocol, int options, int uuid, int open = false)
: JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options), fUUID(uuid), fOpen(open) : JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options), fUUID(uuid), fOpen(open)
{ {
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name); snprintf(fName, sizeof(fName), "%s", name);
} }
...@@ -206,10 +209,13 @@ struct JackClientCheckResult : public JackResult ...@@ -206,10 +209,13 @@ struct JackClientCheckResult : public JackResult
int fStatus; int fStatus;
JackClientCheckResult(): JackResult(), fStatus(0) JackClientCheckResult(): JackResult(), fStatus(0)
{} {
memset(fName, 0, sizeof(fName));
}
JackClientCheckResult(int32_t result, const char* name, int status) JackClientCheckResult(int32_t result, const char* name, int status)
: JackResult(result), fStatus(status) : JackResult(result), fStatus(status)
{ {
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name); snprintf(fName, sizeof(fName), "%s", name);
} }
...@@ -242,10 +248,13 @@ struct JackClientOpenRequest : public JackRequest ...@@ -242,10 +248,13 @@ struct JackClientOpenRequest : public JackRequest
int fUUID; int fUUID;
char fName[JACK_CLIENT_NAME_SIZE+1]; char fName[JACK_CLIENT_NAME_SIZE+1];
JackClientOpenRequest() JackClientOpenRequest() : fPID(0), fUUID(0)
{} {
memset(fName, 0, sizeof(fName));
}
JackClientOpenRequest(const char* name, int pid, int uuid): JackRequest(JackRequest::kClientOpen) JackClientOpenRequest(const char* name, int pid, int uuid): JackRequest(JackRequest::kClientOpen)
{ {
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name); snprintf(fName, sizeof(fName), "%s", name);
fPID = pid; fPID = pid;
fUUID = uuid; fUUID = uuid;
...@@ -318,7 +327,7 @@ struct JackClientCloseRequest : public JackRequest ...@@ -318,7 +327,7 @@ struct JackClientCloseRequest : public JackRequest
int fRefNum; int fRefNum;
JackClientCloseRequest() JackClientCloseRequest() : fRefNum(0)
{} {}
JackClientCloseRequest(int refnum): JackRequest(JackRequest::kClientClose), fRefNum(refnum) JackClientCloseRequest(int refnum): JackRequest(JackRequest::kClientClose), fRefNum(refnum)
{} {}
...@@ -348,7 +357,7 @@ struct JackActivateRequest : public JackRequest ...@@ -348,7 +357,7 @@ struct JackActivateRequest : public JackRequest
int fRefNum; int fRefNum;
int fIsRealTime; int fIsRealTime;
JackActivateRequest() JackActivateRequest() : fRefNum(0), fIsRealTime(0)
{} {}
JackActivateRequest(int refnum, int is_real_time) JackActivateRequest(int refnum, int is_real_time)
: JackRequest(JackRequest::kActivateClient), fRefNum(refnum), fIsRealTime(is_real_time) : JackRequest(JackRequest::kActivateClient), fRefNum(refnum), fIsRealTime(is_real_time)
...@@ -380,7 +389,7 @@ struct JackDeactivateRequest : public JackRequest ...@@ -380,7 +389,7 @@ struct JackDeactivateRequest : public JackRequest
int fRefNum; int fRefNum;
JackDeactivateRequest() JackDeactivateRequest() : fRefNum(0)
{} {}
JackDeactivateRequest(int refnum): JackRequest(JackRequest::kDeactivateClient), fRefNum(refnum) JackDeactivateRequest(int refnum): JackRequest(JackRequest::kDeactivateClient), fRefNum(refnum)
{} {}
...@@ -413,13 +422,18 @@ struct JackPortRegisterRequest : public JackRequest ...@@ -413,13 +422,18 @@ struct JackPortRegisterRequest : public JackRequest
unsigned int fFlags; unsigned int fFlags;
unsigned int fBufferSize; unsigned int fBufferSize;
JackPortRegisterRequest() JackPortRegisterRequest() : fRefNum(0), fFlags(0), fBufferSize(0)
{} {
memset(fName, 0, sizeof(fName));
memset(fPortType, 0, sizeof(fPortType));
}
JackPortRegisterRequest(int refnum, const char* name, const char* port_type, unsigned int flags, unsigned int buffer_size) JackPortRegisterRequest(int refnum, const char* name, const char* port_type, unsigned int flags, unsigned int buffer_size)
: JackRequest(JackRequest::kRegisterPort), fRefNum(refnum), fFlags(flags), fBufferSize(buffer_size) : JackRequest(JackRequest::kRegisterPort), fRefNum(refnum), fFlags(flags), fBufferSize(buffer_size)
{ {
strcpy(fName, name); memset(fName, 0, sizeof(fName));
strcpy(fPortType, port_type); memset(fPortType, 0, sizeof(fPortType));
strncpy(fName, name, sizeof(fName)-1);
strncpy(fPortType, port_type, sizeof(fPortType)-1);
} }
int Read(detail::JackChannelTransactionInterface* trans) int Read(detail::JackChannelTransactionInterface* trans)
...@@ -484,7 +498,7 @@ struct JackPortUnRegisterRequest : public JackRequest ...@@ -484,7 +498,7 @@ struct JackPortUnRegisterRequest : public JackRequest
int fRefNum; int fRefNum;
jack_port_id_t fPortIndex; jack_port_id_t fPortIndex;
JackPortUnRegisterRequest() JackPortUnRegisterRequest() : fRefNum(0), fPortIndex(0)
{} {}
JackPortUnRegisterRequest(int refnum, jack_port_id_t index) JackPortUnRegisterRequest(int refnum, jack_port_id_t index)
: JackRequest(JackRequest::kUnRegisterPort), fRefNum(refnum), fPortIndex(index) : JackRequest(JackRequest::kUnRegisterPort), fRefNum(refnum), fPortIndex(index)
...@@ -520,13 +534,18 @@ struct JackPortConnectNameRequest : public JackRequest ...@@ -520,13 +534,18 @@ struct JackPortConnectNameRequest : public JackRequest
char fSrc[REAL_JACK_PORT_NAME_SIZE+1]; // port full name char fSrc[REAL_JACK_PORT_NAME_SIZE+1]; // port full name
char fDst[REAL_JACK_PORT_NAME_SIZE+1]; // port full name char fDst[REAL_JACK_PORT_NAME_SIZE+1]; // port full name
JackPortConnectNameRequest() JackPortConnectNameRequest() : fRefNum(0)
{} {
memset(fSrc, 0, sizeof(fSrc));
memset(fDst, 0, sizeof(fDst));
}
JackPortConnectNameRequest(int refnum, const char* src_name, const char* dst_name) JackPortConnectNameRequest(int refnum, const char* src_name, const char* dst_name)
: JackRequest(JackRequest::kConnectNamePorts), fRefNum(refnum) : JackRequest(JackRequest::kConnectNamePorts), fRefNum(refnum)
{ {
strcpy(fSrc, src_name); memset(fSrc, 0, sizeof(fSrc));
strcpy(fDst, dst_name); memset(fDst, 0, sizeof(fDst));
strncpy(fSrc, src_name, sizeof(fSrc)-1);
strncpy(fDst, dst_name, sizeof(fDst)-1);
} }
int Read(detail::JackChannelTransactionInterface* trans) int Read(detail::JackChannelTransactionInterface* trans)
...@@ -562,13 +581,18 @@ struct JackPortDisconnectNameRequest : public JackRequest ...@@ -562,13 +581,18 @@ struct JackPortDisconnectNameRequest : public JackRequest
char fSrc[REAL_JACK_PORT_NAME_SIZE+1]; // port full name char fSrc[REAL_JACK_PORT_NAME_SIZE+1]; // port full name
char fDst[REAL_JACK_PORT_NAME_SIZE+1]; // port full name char fDst[REAL_JACK_PORT_NAME_SIZE+1]; // port full name
JackPortDisconnectNameRequest() JackPortDisconnectNameRequest() : fRefNum(0)
{} {
memset(fSrc, 0, sizeof(fSrc));
memset(fDst, 0, sizeof(fDst));
}
JackPortDisconnectNameRequest(int refnum, const char* src_name, const char* dst_name) JackPortDisconnectNameRequest(int refnum, const char* src_name, const char* dst_name)
: JackRequest(JackRequest::kDisconnectNamePorts), fRefNum(refnum) : JackRequest(JackRequest::kDisconnectNamePorts), fRefNum(refnum)
{ {
strcpy(fSrc, src_name); memset(fSrc, 0, sizeof(fSrc));
strcpy(fDst, dst_name); memset(fDst, 0, sizeof(fDst));
strncpy(fSrc, src_name, sizeof(fSrc)-1);
strncpy(fDst, dst_name, sizeof(fDst)-1);
} }
int Read(detail::JackChannelTransactionInterface* trans) int Read(detail::JackChannelTransactionInterface* trans)
...@@ -604,7 +628,7 @@ struct JackPortConnectRequest : public JackRequest ...@@ -604,7 +628,7 @@ struct JackPortConnectRequest : public JackRequest
jack_port_id_t fSrc; jack_port_id_t fSrc;
jack_port_id_t fDst; jack_port_id_t fDst;
JackPortConnectRequest() JackPortConnectRequest() : fRefNum(0), fSrc(0), fDst(0)
{} {}
JackPortConnectRequest(int refnum, jack_port_id_t src, jack_port_id_t dst) JackPortConnectRequest(int refnum, jack_port_id_t src, jack_port_id_t dst)
: JackRequest(JackRequest::kConnectPorts), fRefNum(refnum), fSrc(src), fDst(dst) : JackRequest(JackRequest::kConnectPorts), fRefNum(refnum), fSrc(src), fDst(dst)
...@@ -642,7 +666,7 @@ struct JackPortDisconnectRequest : public JackRequest ...@@ -642,7 +666,7 @@ struct JackPortDisconnectRequest : public JackRequest
jack_port_id_t fSrc; jack_port_id_t fSrc;
jack_port_id_t fDst; jack_port_id_t fDst;
JackPortDisconnectRequest() JackPortDisconnectRequest() : fRefNum(0), fSrc(0), fDst(0)
{} {}
JackPortDisconnectRequest(int refnum, jack_port_id_t src, jack_port_id_t dst) JackPortDisconnectRequest(int refnum, jack_port_id_t src, jack_port_id_t dst)
: JackRequest(JackRequest::kDisconnectPorts), fRefNum(refnum), fSrc(src), fDst(dst) : JackRequest(JackRequest::kDisconnectPorts), fRefNum(refnum), fSrc(src), fDst(dst)
...@@ -680,12 +704,15 @@ struct JackPortRenameRequest : public JackRequest ...@@ -680,12 +704,15 @@ struct JackPortRenameRequest : public JackRequest
jack_port_id_t fPort; jack_port_id_t fPort;
char fName[JACK_PORT_NAME_SIZE + 1]; // port short name char fName[JACK_PORT_NAME_SIZE + 1]; // port short name
JackPortRenameRequest() JackPortRenameRequest() : fRefNum(0), fPort(0)
{} {
memset(fName, 0, sizeof(fName));
}
JackPortRenameRequest(int refnum, jack_port_id_t port, const char* name) JackPortRenameRequest(int refnum, jack_port_id_t port, const char* name)
: JackRequest(JackRequest::kPortRename), fRefNum(refnum), fPort(port) : JackRequest(JackRequest::kPortRename), fRefNum(refnum), fPort(port)
{ {
strcpy(fName, name); memset(fName, 0, sizeof(fName));
strncpy(fName, name, sizeof(fName)-1);
} }
int Read(detail::JackChannelTransactionInterface* trans) int Read(detail::JackChannelTransactionInterface* trans)
...@@ -719,7 +746,7 @@ struct JackSetBufferSizeRequest : public JackRequest ...@@ -719,7 +746,7 @@ struct JackSetBufferSizeRequest : public JackRequest
jack_nframes_t fBufferSize; jack_nframes_t fBufferSize;
JackSetBufferSizeRequest() JackSetBufferSizeRequest() : fBufferSize(0)
{} {}
JackSetBufferSizeRequest(jack_nframes_t buffer_size) JackSetBufferSizeRequest(jack_nframes_t buffer_size)
: JackRequest(JackRequest::kSetBufferSize), fBufferSize(buffer_size) : JackRequest(JackRequest::kSetBufferSize), fBufferSize(buffer_size)
...@@ -749,7 +776,7 @@ struct JackSetFreeWheelRequest : public JackRequest ...@@ -749,7 +776,7 @@ struct JackSetFreeWheelRequest : public JackRequest
int fOnOff; int fOnOff;
JackSetFreeWheelRequest() JackSetFreeWheelRequest() : fOnOff(0)
{} {}
JackSetFreeWheelRequest(int onoff) JackSetFreeWheelRequest(int onoff)
: JackRequest(JackRequest::kSetFreeWheel), fOnOff(onoff) : JackRequest(JackRequest::kSetFreeWheel), fOnOff(onoff)
...@@ -806,7 +833,7 @@ struct JackReleaseTimebaseRequest : public JackRequest ...@@ -806,7 +833,7 @@ struct JackReleaseTimebaseRequest : public JackRequest
int fRefNum; int fRefNum;
JackReleaseTimebaseRequest() JackReleaseTimebaseRequest() : fRefNum(0)
{} {}
JackReleaseTimebaseRequest(int refnum) JackReleaseTimebaseRequest(int refnum)
: JackRequest(JackRequest::kReleaseTimebase), fRefNum(refnum) : JackRequest(JackRequest::kReleaseTimebase), fRefNum(refnum)
...@@ -838,7 +865,7 @@ struct JackSetTimebaseCallbackRequest : public JackRequest ...@@ -838,7 +865,7 @@ struct JackSetTimebaseCallbackRequest : public JackRequest
int fRefNum; int fRefNum;
int fConditionnal; int fConditionnal;
JackSetTimebaseCallbackRequest() JackSetTimebaseCallbackRequest() : fRefNum(0), fConditionnal(0)
{} {}
JackSetTimebaseCallbackRequest(int refnum, int conditional) JackSetTimebaseCallbackRequest(int refnum, int conditional)
: JackRequest(JackRequest::kSetTimebaseCallback), fRefNum(refnum), fConditionnal(conditional) : JackRequest(JackRequest::kSetTimebaseCallback), fRefNum(refnum), fConditionnal(conditional)
...@@ -871,7 +898,7 @@ struct JackGetInternalClientNameRequest : public JackRequest ...@@ -871,7 +898,7 @@ struct JackGetInternalClientNameRequest : public JackRequest
int fRefNum; int fRefNum;
int fIntRefNum; int fIntRefNum;
JackGetInternalClientNameRequest() JackGetInternalClientNameRequest() : fRefNum(0), fIntRefNum(0)
{} {}
JackGetInternalClientNameRequest(int refnum, int int_ref) JackGetInternalClientNameRequest(int refnum, int int_ref)
: JackRequest(JackRequest::kGetInternalClientName), fRefNum(refnum), fIntRefNum(int_ref) : JackRequest(JackRequest::kGetInternalClientName), fRefNum(refnum), fIntRefNum(int_ref)
...@@ -904,10 +931,13 @@ struct JackGetInternalClientNameResult : public JackResult ...@@ -904,10 +931,13 @@ struct JackGetInternalClientNameResult : public JackResult
char fName[JACK_CLIENT_NAME_SIZE+1]; char fName[JACK_CLIENT_NAME_SIZE+1];
JackGetInternalClientNameResult(): JackResult() JackGetInternalClientNameResult(): JackResult()
{} {
memset(fName, 0, sizeof(fName));
}
JackGetInternalClientNameResult(int32_t result, const char* name) JackGetInternalClientNameResult(int32_t result, const char* name)
: JackResult(result) : JackResult(result)
{ {
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name); snprintf(fName, sizeof(fName), "%s", name);
} }
...@@ -938,11 +968,14 @@ struct JackInternalClientHandleRequest : public JackRequest ...@@ -938,11 +968,14 @@ struct JackInternalClientHandleRequest : public JackRequest
int fRefNum; int fRefNum;
char fName[JACK_CLIENT_NAME_SIZE+1]; char fName[JACK_CLIENT_NAME_SIZE+1];
JackInternalClientHandleRequest() JackInternalClientHandleRequest() : fRefNum(0)
{} {
memset(fName, 0, sizeof(fName));
}
JackInternalClientHandleRequest(int refnum, const char* client_name) JackInternalClientHandleRequest(int refnum, const char* client_name)
: JackRequest(JackRequest::kInternalClientHandle), fRefNum(refnum) : JackRequest(JackRequest::kInternalClientHandle), fRefNum(refnum)
{ {
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", client_name); snprintf(fName, sizeof(fName), "%s", client_name);
} }
...@@ -973,7 +1006,7 @@ struct JackInternalClientHandleResult : public JackResult ...@@ -973,7 +1006,7 @@ struct JackInternalClientHandleResult : public JackResult
int fStatus; int fStatus;
int fIntRefNum; int fIntRefNum;
JackInternalClientHandleResult(): JackResult() JackInternalClientHandleResult(): JackResult(), fStatus(0), fIntRefNum(0)
{} {}
JackInternalClientHandleResult(int32_t result, int status, int int_ref) JackInternalClientHandleResult(int32_t result, int status, int int_ref)
: JackResult(result), fStatus(status), fIntRefNum(int_ref) : JackResult(result), fStatus(status), fIntRefNum(int_ref)
...@@ -1016,15 +1049,21 @@ struct JackInternalClientLoadRequest : public JackRequest ...@@ -1016,15 +1049,21 @@ struct JackInternalClientLoadRequest : public JackRequest
int fOptions; int fOptions;
int fUUID; int fUUID;
JackInternalClientLoadRequest() JackInternalClientLoadRequest() : fRefNum(0), fOptions(0), fUUID(0)
{} {
memset(fName, 0, sizeof(fName));
memset(fDllName, 0, sizeof(fDllName));
memset(fLoadInitName, 0, sizeof(fLoadInitName));
}
JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int uuid ) JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int uuid )
: JackRequest(JackRequest::kInternalClientLoad), fRefNum(refnum), fOptions(options), fUUID(uuid) : JackRequest(JackRequest::kInternalClientLoad), fRefNum(refnum), fOptions(options), fUUID(uuid)
{ {
memset(fName, 0, sizeof(fName));
memset(fDllName, 0, sizeof(fDllName));
memset(fLoadInitName, 0, sizeof(fLoadInitName));
snprintf(fName, sizeof(fName), "%s", client_name); snprintf(fName, sizeof(fName), "%s", client_name);
snprintf(fDllName, sizeof(fDllName), "%s", so_name); snprintf(fDllName, sizeof(fDllName), "%s", so_name);
snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data); snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data);
snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data);
} }
int Read(detail::JackChannelTransactionInterface* trans) int Read(detail::JackChannelTransactionInterface* trans)
...@@ -1062,7 +1101,7 @@ struct JackInternalClientLoadResult : public JackResult ...@@ -1062,7 +1101,7 @@ struct JackInternalClientLoadResult : public JackResult
int fStatus; int fStatus;
int fIntRefNum; int fIntRefNum;
JackInternalClientLoadResult(): JackResult() JackInternalClientLoadResult(): JackResult(), fStatus(0), fIntRefNum(0)
{} {}
JackInternalClientLoadResult(int32_t result, int status, int int_ref) JackInternalClientLoadResult(int32_t result, int status, int int_ref)
: JackResult(result), fStatus(status), fIntRefNum(int_ref) : JackResult(result), fStatus(status), fIntRefNum(int_ref)
...@@ -1097,7 +1136,7 @@ struct JackInternalClientUnloadRequest : public JackRequest ...@@ -1097,7 +1136,7 @@ struct JackInternalClientUnloadRequest : public JackRequest
int fRefNum; int fRefNum;
int fIntRefNum; int fIntRefNum;
JackInternalClientUnloadRequest() JackInternalClientUnloadRequest() : fRefNum(0), fIntRefNum(0)
{} {}
JackInternalClientUnloadRequest(int refnum, int int_ref) JackInternalClientUnloadRequest(int refnum, int int_ref)
: JackRequest(JackRequest::kInternalClientUnload), fRefNum(refnum), fIntRefNum(int_ref) : JackRequest(JackRequest::kInternalClientUnload), fRefNum(refnum), fIntRefNum(int_ref)
...@@ -1129,7 +1168,7 @@ struct JackInternalClientUnloadResult : public JackResult ...@@ -1129,7 +1168,7 @@ struct JackInternalClientUnloadResult : public JackResult
int fStatus; int fStatus;
JackInternalClientUnloadResult(): JackResult() JackInternalClientUnloadResult(): JackResult(), fStatus(0)
{} {}
JackInternalClientUnloadResult(int32_t result, int status) JackInternalClientUnloadResult(int32_t result, int status)
: JackResult(result), fStatus(status) : JackResult(result), fStatus(status)
...@@ -1163,7 +1202,7 @@ struct JackClientNotificationRequest : public JackRequest ...@@ -1163,7 +1202,7 @@ struct JackClientNotificationRequest : public JackRequest
int fNotify; int fNotify;
int fValue; int fValue;
JackClientNotificationRequest() JackClientNotificationRequest() : fRefNum(0), fNotify(0), fValue(0)
{} {}
JackClientNotificationRequest(int refnum, int notify, int value) JackClientNotificationRequest(int refnum, int notify, int value)
: JackRequest(JackRequest::kNotification), fRefNum(refnum), fNotify(notify), fValue(value) : JackRequest(JackRequest::kNotification), fRefNum(refnum), fNotify(notify), fValue(value)
...@@ -1198,14 +1237,20 @@ struct JackSessionCommand ...@@ -1198,14 +1237,20 @@ struct JackSessionCommand
char fCommand[JACK_SESSION_COMMAND_SIZE]; char fCommand[JACK_SESSION_COMMAND_SIZE];
jack_session_flags_t fFlags; jack_session_flags_t fFlags;
JackSessionCommand() JackSessionCommand() : fFlags(JackSessionSaveError)
{} {
memset(fUUID, 0, sizeof(fUUID));
memset(fClientName, 0, sizeof(fClientName));
memset(fCommand, 0, sizeof(fCommand));
}
JackSessionCommand(const char *uuid, const char *clientname, const char *command, jack_session_flags_t flags) JackSessionCommand(const char *uuid, const char *clientname, const char *command, jack_session_flags_t flags)
{ {
strncpy(fUUID, uuid, sizeof(fUUID)); memset(fUUID, 0, sizeof(fUUID));
strncpy(fClientName, clientname, sizeof(fClientName)); memset(fClientName, 0, sizeof(fClientName));
strncpy(fCommand, command, sizeof(fCommand)); memset(fCommand, 0, sizeof(fCommand));
strncpy(fUUID, uuid, sizeof(fUUID)-1);
strncpy(fClientName, clientname, sizeof(fClientName)-1);
strncpy(fCommand, command, sizeof(fCommand)-1);
fFlags = flags; fFlags = flags;
} }
}; };
...@@ -1310,16 +1355,18 @@ struct JackSessionNotifyRequest : public JackRequest ...@@ -1310,16 +1355,18 @@ struct JackSessionNotifyRequest : public JackRequest
jack_session_event_type_t fEventType; jack_session_event_type_t fEventType;
int fRefNum; int fRefNum;
JackSessionNotifyRequest() JackSessionNotifyRequest() : fEventType(JackSessionSave), fRefNum(0)
{} {}
JackSessionNotifyRequest(int refnum, const char* path, jack_session_event_type_t type, const char* dst) JackSessionNotifyRequest(int refnum, const char* path, jack_session_event_type_t type, const char* dst)
: JackRequest(JackRequest::kSessionNotify), fEventType(type), fRefNum(refnum) : JackRequest(JackRequest::kSessionNotify), fEventType(type), fRefNum(refnum)
{ {
memset(fPath, 0, sizeof(fPath));
memset(fDst, 0, sizeof(fDst));
snprintf(fPath, sizeof(fPath), "%s", path); snprintf(fPath, sizeof(fPath), "%s", path);
fPath[JACK_MESSAGE_SIZE] = 0;
if (dst) { if (dst) {
snprintf(fDst, sizeof(fDst), "%s", dst); snprintf(fDst, sizeof(fDst), "%s", dst);
} else { fDst[JACK_CLIENT_NAME_SIZE] = 0;
fDst[0] = '\0';
} }
} }
...@@ -1350,7 +1397,7 @@ struct JackSessionReplyRequest : public JackRequest ...@@ -1350,7 +1397,7 @@ struct JackSessionReplyRequest : public JackRequest
{ {
int fRefNum; int fRefNum;
JackSessionReplyRequest() JackSessionReplyRequest() : fRefNum(0)
{} {}
JackSessionReplyRequest(int refnum) JackSessionReplyRequest(int refnum)
...@@ -1380,10 +1427,13 @@ struct JackClientNameResult : public JackResult ...@@ -1380,10 +1427,13 @@ struct JackClientNameResult : public JackResult
char fName[JACK_CLIENT_NAME_SIZE+1]; char fName[JACK_CLIENT_NAME_SIZE+1];
JackClientNameResult(): JackResult() JackClientNameResult(): JackResult()
{} {
memset(fName, 0, sizeof(fName));
}
JackClientNameResult(int32_t result, const char* name) JackClientNameResult(int32_t result, const char* name)
: JackResult(result) : JackResult(result)
{ {
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name); snprintf(fName, sizeof(fName), "%s", name);
} }
...@@ -1408,10 +1458,13 @@ struct JackUUIDResult : public JackResult ...@@ -1408,10 +1458,13 @@ struct JackUUIDResult : public JackResult
char fUUID[JACK_UUID_SIZE]; char fUUID[JACK_UUID_SIZE];
JackUUIDResult(): JackResult() JackUUIDResult(): JackResult()
{} {
memset(fUUID, 0, sizeof(fUUID));
}
JackUUIDResult(int32_t result, const char* uuid) JackUUIDResult(int32_t result, const char* uuid)
: JackResult(result) : JackResult(result)
{ {
memset(fUUID, 0, sizeof(fUUID));
snprintf(fUUID, sizeof(fUUID), "%s", uuid); snprintf(fUUID, sizeof(fUUID), "%s", uuid);
} }
...@@ -1436,12 +1489,15 @@ struct JackGetUUIDRequest : public JackRequest ...@@ -1436,12 +1489,15 @@ struct JackGetUUIDRequest : public JackRequest
char fName[JACK_CLIENT_NAME_SIZE+1]; char fName[JACK_CLIENT_NAME_SIZE+1];
JackGetUUIDRequest() JackGetUUIDRequest()
{}