Browse Source

Merge pull request #20 from metalefty/sockname

Fix segfault when socket names not given via env #19
pull/28/head
metalefty 6 years ago
committed by GitHub
parent
commit
113c2523da
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions
  1. +3
    -2
      src/module-xrdp-sink.c
  2. +3
    -2
      src/module-xrdp-source.c

+ 3
- 2
src/module-xrdp-sink.c View File

@ -322,13 +322,14 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) {
pa_log_debug("Could not obtain sink_socket from environment.");
/* usually it doesn't reach here. if the socket name is not given
via environment variable, use hardcoded name as fallback */
snprintf(sink_socket, bytes, "xrdp_chansrv_audio_out_socket_%d", u->display_num);
snprintf(s.sun_path, bytes,
"%s/xrdp_chansrv_audio_out_socket_%d", socket_dir, u->display_num);
}
else
{
pa_log_debug("Obtained sink_socket from environment.");
snprintf(s.sun_path, bytes, "%s/%s", socket_dir, sink_socket);
}
snprintf(s.sun_path, bytes, "%s/%s", socket_dir, sink_socket);
pa_log_debug("trying to connect to %s", s.sun_path);
if (connect(fd, (struct sockaddr *)&s,


+ 3
- 2
src/module-xrdp-source.c View File

@ -200,13 +200,14 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) {
pa_log("Could not obtain source_socket from environment.");
/* usually it doesn't reach here. if the socket name is not given
via environment variable, use hardcoded name as fallback */
snprintf(source_socket, bytes, "xrdp_chansrv_audio_in_socket_%d", u->display_num);
snprintf(s.sun_path, bytes,
"%s/xrdp_chansrv_audio_in_socket_%d", socket_dir, u->display_num);
}
else
{
pa_log("Obtained sink_socket from environment.");
snprintf(s.sun_path, bytes, "%s/%s", socket_dir, source_socket);
}
snprintf(s.sun_path, bytes, "%s/%s", socket_dir, source_socket);
pa_log_debug("Trying to connect to %s", s.sun_path);
if (connect(fd, (struct sockaddr *) &s, sizeof(struct sockaddr_un)) != 0) {


Loading…
Cancel
Save