Skip to content

Commit

Permalink
Use container size rather than magic number 64
Browse files Browse the repository at this point in the history
  • Loading branch information
metalefty committed Sep 7, 2023
1 parent d4bb793 commit 747c98f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libxrdp/xrdp_caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: NSCodec(%s), codec id [%d], properties len [%d]",
codec_guid_str, codec_id, codec_properties_length);
self->client_info.ns_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
i1 = MIN(sizeof(self->client_info.ns_prop), codec_properties_length);
g_memcpy(self->client_info.ns_prop, s->p, i1);
self->client_info.ns_prop_len = i1;
}
Expand All @@ -573,7 +573,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: RemoteFX(%s), codec id [%d], properties len [%d]",
codec_guid_str, codec_id, codec_properties_length);
self->client_info.rfx_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
i1 = MIN(sizeof(self->client_info.rfx_prop), codec_properties_length);
g_memcpy(self->client_info.rfx_prop, s->p, i1);
self->client_info.rfx_prop_len = i1;
}
Expand All @@ -582,7 +582,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: Image RemoteFX(%s), codec id [%d], properties len [%d]",
codec_guid_str, codec_id, codec_properties_length);
self->client_info.irfx_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
i1 = MIN(sizeof(self->client_info.irfx_prop), codec_properties_length);

g_memcpy(self->client_info.irfx_prop, s->p, i1);
self->client_info.irfx_prop_len = i1;
Expand All @@ -609,7 +609,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: H264(%s), codec id [%d], properties len [%d]",
codec_guid_str, codec_id, codec_properties_length);
self->client_info.h264_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
i1 = MIN(sizeof(self->client_info.h264_prop), codec_properties_length);
g_memcpy(self->client_info.h264_prop, s->p, i1);
self->client_info.h264_prop_len = i1;
}
Expand Down

0 comments on commit 747c98f

Please sign in to comment.