Skip to content

Commit

Permalink
shm main BUGFIX do not store unterminated strings
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Jun 18, 2024
1 parent bb36b48 commit ec6231a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ sr_shmmain_open(sr_shm_t *shm, int *created)
ATOMIC_STORE_RELAXED(main_shm->new_sr_sid, 1);
ATOMIC_STORE_RELAXED(main_shm->new_sub_id, 1);
ATOMIC_STORE_RELAXED(main_shm->new_evpipe_num, 1);
strncpy(main_shm->repo_path, sr_get_repo_path(), sizeof main_shm->repo_path);
strncpy(main_shm->repo_path, sr_get_repo_path(), sizeof main_shm->repo_path - 1);

/* remove leftover event pipes */
sr_remove_evpipes();
Expand Down

0 comments on commit ec6231a

Please sign in to comment.