mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2025-12-06 02:40:26 -08:00
Fixed a NUL-termination bug in SOCKET-BIND and SOCKET-CONNECT.
The backslash in '\0' got lost on the way to the generated C file (build/ext/sockets.c). There may be more of these issues elsewhere in the code base. This resolves CIDs 66405 and 66413 (Buffer not null terminated).
This commit is contained in:
parent
633c3a5f63
commit
fa48714dd8
1 changed files with 2 additions and 2 deletions
|
|
@ -845,7 +845,7 @@ also known as unix-domain sockets."))
|
|||
##endif
|
||||
sockaddr.sun_family = #2;
|
||||
strncpy(sockaddr.sun_path,#1,sizeof(sockaddr.sun_path));
|
||||
sockaddr.sun_path[sizeof(sockaddr.sun_path)-1] = '\0';
|
||||
sockaddr.sun_path[sizeof(sockaddr.sun_path)-1] = 0;
|
||||
|
||||
ecl_disable_interrupts();
|
||||
output = bind(#0,(struct sockaddr*)&sockaddr, sizeof(struct sockaddr_un));
|
||||
|
|
@ -895,7 +895,7 @@ also known as unix-domain sockets."))
|
|||
##endif
|
||||
sockaddr.sun_family = #1;
|
||||
strncpy(sockaddr.sun_path,#2,sizeof(sockaddr.sun_path));
|
||||
sockaddr.sun_path[sizeof(sockaddr.sun_path)-1] = '\0';
|
||||
sockaddr.sun_path[sizeof(sockaddr.sun_path)-1] = 0;
|
||||
|
||||
ecl_disable_interrupts();
|
||||
output = connect(#0,(struct sockaddr*)&sockaddr, sizeof(struct sockaddr_un));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue