TT#111150 fix coverity warnings

don't use strncpy

check for null pointer

Change-Id: Ie557d395152c20f1c96bb3abf15935700a84d917
pull/1307/head
Richard Fuchs 4 years ago
parent fafc1d73ec
commit 9ad5378b5f

@ -1525,7 +1525,7 @@ static const struct streamhandler *__determine_handler(struct packet_stream *in,
must_recrypt = 1;
else if (in->rtp_sinks.length > 1 || in->rtcp_sinks.length > 1) // need a proper decrypter?
must_recrypt = 1;
else if (in_proto->srtp && out_proto->srtp
else if (in_proto->srtp && out_proto && out_proto->srtp
&& in->selected_sfd && out && out->selected_sfd
&& (crypto_params_cmp(&in->crypto.params, &out->selected_sfd->crypto.params)
|| crypto_params_cmp(&out->crypto.params, &in->selected_sfd->crypto.params)))

@ -178,8 +178,8 @@ out:
if (mf->recording_on && !ret->output && output_single) {
dbg("Metadata %s, output destination %s", mf->metadata, mf->output_dest);
if (mf->output_dest) {
char path[256];
strncpy(path, mf->output_dest, sizeof(path));
char path[PATH_MAX];
g_strlcpy(path, mf->output_dest, sizeof(path));
char *sep = strrchr(path, '/');
if (sep) {
char *filename = sep + 1;

Loading…
Cancel
Save