Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointer to lseek is left uninitialized in ciaaSerialDevices_addDriver() #444

Open
glpuga opened this issue Sep 28, 2016 · 3 comments
Open

Comments

@glpuga
Copy link
Contributor

glpuga commented Sep 28, 2016

The following fragment of ciaaSerialDevices_addDriver() in ciaaSerialDevices.c should probably also copy the pointer for lseek, or set it to NULL if is not used for this kind of device.

/* allocate memory for new device */
newDevice = (ciaaDevices_deviceType*) ciaak_malloc(sizeof(ciaaDevices_deviceType));

/* set functions for this device */
newDevice->open = ciaaSerialDevices_open;
newDevice->close = ciaaSerialDevices_close;
newDevice->ioctl = ciaaSerialDevices_ioctl;
newDevice->read = ciaaSerialDevices_read;
newDevice->write = ciaaSerialDevices_write;

/* store layers information information */
newDevice->layer = (void *) &ciaaSerialDevices.devstr[position];
newDevice->loLayer = (void *) driver;
@mabeett mabeett added the Posix label Sep 29, 2016
@mabeett
Copy link
Contributor

mabeett commented Sep 29, 2016

Related files in the current master branch
modules/posix/src/ciaaSerialDevices.c#L157
modules/posix/inc/ciaaDevices.h#L107

@mabeett mabeett added the bug label Sep 29, 2016
@mcerdeiro
Copy link
Contributor

Hello Gerardo,

This is a serial driver so it doesn't have a lseek. So I guess it shall
never been called. If so we have to set it to null.

What do you think?

Am 28.09.2016 6:06 AM schrieb "Gerardo Puga" [email protected]:

The following fragment of ciaaSerialDevices_addDriver() in
ciaaSerialDevices.c should probably also copy the pointer for lseek.

/* allocate memory for new device /
newDevice = (ciaaDevices_deviceType
) ciaak_malloc(sizeof(ciaaDevices_deviceType));

/* set functions for this device */
newDevice->open = ciaaSerialDevices_open;
newDevice->close = ciaaSerialDevices_close;
newDevice->ioctl = ciaaSerialDevices_ioctl;
newDevice->read = ciaaSerialDevices_read;
newDevice->write = ciaaSerialDevices_write;

/* store layers information information */
newDevice->layer = (void *) &ciaaSerialDevices.devstr[position];
newDevice->loLayer = (void *) driver;


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#444, or mute the thread
https://github.com/notifications/unsubscribe-auth/AG7km9NBNbCh35wnIquGbvub7nw0V-o2ks5quefSgaJpZM4KIZV9
.

@glpuga
Copy link
Contributor Author

glpuga commented Sep 29, 2016

Sounds ok to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants