Skip to content

Commit

Permalink
[issue NeuronRobotics#229] Prevent Buffer Overflows When Constructing…
Browse files Browse the repository at this point in the history
… Messages

- increase buffer sizes
- change sprintf() calls to snprintf() calls introducing respective
maximum size arguments
- remove #if / #endif blocks dealing with system names on Linux
- comment message informing the user that locking worked
- correct variable name and remove unused buffer name[80] in uucp_lock()

closes NeuronRobotics#229
  • Loading branch information
david-pace authored and Claudia Pellegrino committed Nov 9, 2023
1 parent d7a150e commit 208d80a
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 112 deletions.
1 change: 0 additions & 1 deletion src/main/c/include/SerialImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,5 +501,4 @@ int check_lock_pid( const char *, int );
int printj(JNIEnv *env, wchar_t *fmt, ...);

#define UNEXPECTED_LOCK_FILE "RXTX Error: Unexpected lock file: %s\n Please report to the RXTX developers\n"
#define LINUX_KERNEL_VERSION_ERROR "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n"
#define UUCP_ERROR "\n\n\nRXTX WARNING: This library requires the user running applications to be in\ngroup uucp. Please consult the INSTALL documentation. More information is\navaiable under the topic 'How can I use Lock Files with rxtx?'\n"
Loading

0 comments on commit 208d80a

Please sign in to comment.