Skip to content

Commit

Permalink
#3148 incorrect use of buffer api
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed May 31, 2021
1 parent b66a358 commit ae56b87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xpra/server/pam.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ cdef class pam_session:

def start(self, password=False) -> bool:
cdef pam_conv conv
cdef Py_buffer *view = NULL
cdef Py_buffer view

if self.pam_handle!=NULL:
log.error("Error: cannot open the pam session more than once!")
Expand All @@ -164,7 +164,7 @@ cdef class pam_session:
if password:
conv.conv = <void_p> &password_conv
assert self.password, "no password to use for pam_start"
if PyObject_GetBuffer(self.password, view, PyBUF_ANY_CONTIGUOUS):
if PyObject_GetBuffer(self.password, &view, PyBUF_ANY_CONTIGUOUS):
raise Exception("failed to read password data")
conv.appdata_ptr = view.buf
else:
Expand All @@ -175,7 +175,7 @@ cdef class pam_session:
pam_start(strtobytes(self.service_name), strtobytes(self.username), &conv, &self.pam_handle)
finally:
if view!=NULL:
PyBuffer_Release(view)
PyBuffer_Release(&view)
log("pam_start: %s", PAM_ERR_STR.get(r, r))
if r!=PAM_SUCCESS:
self.pam_handle = NULL
Expand Down

0 comments on commit ae56b87

Please sign in to comment.