Re: [PATCH 4/4] device/chario.c (char_write): avoid segmentation fault

2013-12-15 Thread Richard Braun
On Sat, Dec 14, 2013 at 01:32:27PM +0100, Marin Ramesa wrote: On 14.12.2013 12:45:32, Richard Braun wrote: I really don't see a problem in that code, you'll have to describe it better. So a pointer to io_data is cast to a pointer to a vm_map_copy structure and then passed to

Re: [PATCH 4/4] device/chario.c (char_write): avoid segmentation fault

2013-12-15 Thread Marin Ramesa
On 15.12.2013 14:00:22, Richard Braun wrote: On Sat, Dec 14, 2013 at 01:32:27PM +0100, Marin Ramesa wrote: On 14.12.2013 12:45:32, Richard Braun wrote: I really don't see a problem in that code, you'll have to describe it better. So a pointer to io_data is cast to a pointer to a

Re: [PATCH 4/4] device/chario.c (char_write): avoid segmentation fault

2013-12-15 Thread Richard Braun
On Sun, Dec 15, 2013 at 02:43:50PM +0100, Marin Ramesa wrote: On 15.12.2013 14:00:22, Richard Braun wrote: What makes you think the content could be something else than a vm_map_copy object ? Well io_data is a pointer to char, not a pointer to vm_map_copy. And there is not one member in

Re: [PATCH 4/4] device/chario.c (char_write): avoid segmentation fault

2013-12-14 Thread Richard Braun
On Fri, Dec 13, 2013 at 09:06:55PM +0100, Marin Ramesa wrote: Check if the source of the data in the source structure memory is a target structure data. Do this by comparing the length of the char values starting with the source address until null-termination to the size of the target

Re: [PATCH 4/4] device/chario.c (char_write): avoid segmentation fault

2013-12-14 Thread Marin Ramesa
On 14.12.2013 12:45:32, Richard Braun wrote: On Fri, Dec 13, 2013 at 09:06:55PM +0100, Marin Ramesa wrote: Check if the source of the data in the source structure memory is a target structure data. Do this by comparing the length of the char values starting with the source address until

[PATCH 4/4] device/chario.c (char_write): avoid segmentation fault

2013-12-13 Thread Marin Ramesa
The situation is that there is a pointer (source) that is being cast to another pointer (target) and then the members of the target structure pointed to by the target pointer are being used as if the content of memory at the source address is a target structure, not source structure pointed to by