mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-26 19:01:27 +00:00
Fix out of bounds write on platforms where sizeof(bool) != 1
Found by code scanning
This commit is contained in:
parent
209b78a3ec
commit
dad7d366b3
1 changed files with 2 additions and 2 deletions
|
|
@ -123,7 +123,7 @@ new(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) {
|
|||
) {
|
||||
Py_CLEAR(self); return NULL;
|
||||
}
|
||||
self->alt_tabstops = self->main_tabstops + self->columns * sizeof(bool);
|
||||
self->alt_tabstops = self->main_tabstops + self->columns;
|
||||
self->tabstops = self->main_tabstops;
|
||||
init_tabstops(self->main_tabstops, self->columns);
|
||||
init_tabstops(self->alt_tabstops, self->columns);
|
||||
|
|
@ -236,7 +236,7 @@ screen_resize(Screen *self, unsigned int lines, unsigned int columns) {
|
|||
PyMem_Free(self->main_tabstops);
|
||||
self->main_tabstops = PyMem_Calloc(2*self->columns, sizeof(bool));
|
||||
if (self->main_tabstops == NULL) { PyErr_NoMemory(); return false; }
|
||||
self->alt_tabstops = self->main_tabstops + self->columns * sizeof(bool);
|
||||
self->alt_tabstops = self->main_tabstops + self->columns;
|
||||
self->tabstops = self->main_tabstops;
|
||||
init_tabstops(self->main_tabstops, self->columns);
|
||||
init_tabstops(self->alt_tabstops, self->columns);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue