Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ea64063f
Commit
ea64063f
authored
Mar 21, 2014
by
Daniel Colascione
Browse files
Do not read unitialized memory in conv_sockaddr_to_lisp
parent
aa465907
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/mail/emacsbug.el
lisp/mail/emacsbug.el
+4
-0
src/ChangeLog
src/ChangeLog
+6
-0
src/process.c
src/process.c
+16
-4
No files found.
lisp/ChangeLog
View file @
ea64063f
2014-03-21 Daniel Colascione <dancol@dancol.org>
* mail/emacsbug.el (report-emacs-bug): Include memory usage
information in bug reports.
2014-03-21 Glenn Morris <rgm@gnu.org>
* Makefile.in ($(MH_E_DIR)/mh-loaddefs.el)
...
...
lisp/mail/emacsbug.el
View file @
ea64063f
...
...
@@ -322,6 +322,10 @@ usually do not have translators for other languages.\n\n")))
shadows
)))
(
insert
(
format
"\nFeatures:\n%s\n"
features
))
(
fill-region
(
line-beginning-position
0
)
(
point
))
(
insert
(
format
"\nMemory information:\n"
))
(
pp
(
garbage-collect
)
(
current-buffer
))
;; This is so the user has to type something in order to send easily.
(
use-local-map
(
nconc
(
make-sparse-keymap
)
(
current-local-map
)))
(
define-key
(
current-local-map
)
"\C-c\C-i"
'info-emacs-bug
)
...
...
src/ChangeLog
View file @
ea64063f
2014-03-22 Daniel Colascione <dancol@dancol.org>
* process.c (conv_sockaddr_to_lisp): When extracting the string
names of AF_LOCAL sockets, stop before reading uninitialized
memory.
2014-03-21 Daniel Colascione <dancol@dancol.org>
* xterm.c (x_bitmap_icon): Stop reading the icon bitmap from disk
...
...
src/process.c
View file @
ea64063f
...
...
@@ -2010,10 +2010,22 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, int len)
case AF_LOCAL:
{
struct sockaddr_un *sockun = (struct sockaddr_un *) sa;
for (i = 0; i < sizeof (sockun->sun_path); i++)
if (sockun->sun_path[i] == 0)
break;
return make_unibyte_string (sockun->sun_path, i);
ptrdiff_t name_length = len - offsetof (struct sockaddr_un, sun_path);
/* If the first byte is NUL, the name is a Linux abstract
socket name, and the name can contain embedded NULs. If
it's not, we have a NUL-terminated string. Be careful not
to walk past the end of the object looking for the name
terminator, however. */
if (name_length > 0 && sockun->sun_path[0] != '\0')
{
const char* terminator =
memchr (sockun->sun_path, '\0', name_length);
if (terminator)
name_length = terminator - (const char*) sockun->sun_path;
}
return make_unibyte_string (sockun->sun_path, name_length);
}
#endif
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment