On 09/06/2012 03:52 AM, Zbigniew Kosinski wrote: > Hello, > > After many opinion from developers mailing list users, I see that my patch > proposal wasn't good. There are better ways to solve that kind of problem. > Some of users suggest to use eina macros to check nulls that can be > enabled/disabled. Is EINA_SAFETY_ON_NULL_RETURN_VAL macro is good > candidate? > > > I know that passing NULL as name parameter is non-sensical - that can bug > in > my code. Maybe better solution is to add information in > e_dbus_request_name > documentation - "NULL is not supported" or "NULL will cause SIGABRT" . > After that developers are fully responsible for parameters they pass to > e_dbus public API. I don't know about everyone else, but I assume that passing NULL to any function will cause a segv UNLESS it's noted in the documentation to allow that function to perform some functionality (such as delete/cleanup/etc). I wouldn't expect a function's documentation to tell me that passing NULL will cause a segv and in fact it may not depending on where the code is built and what it does. What if you give it an invalid pointer instead, should the document explain all the possible outcomes there as well? Forget the segv, you could jump into kernel memory, overwrite some files, all kinds of fun! > > > ------- Original Message ------- > > Sender : Carsten Haitzler<ras...@rasterman.com> > > Date : Sep 05, 2012 19:28 (GMT+09:00) > > Title : Re: [E-devel] Function e_dbus_request_name > > > On Wed, 05 Sep 2012 05:39:08 +0000 (GMT) Zbigniew Kosinski > said: > what are you doing asking for a NULL name? that's non-sensical. it's > definitely > an error in your code. libdbus itself is aborting. > nb - have u tested strdup(NULL); ? it segv's . glibc people won't likely > accept > patches to "check for NULL" as its simply invalid input. :) > so here is my question. why do you think this routine SHOULD check for > null > and > return instead of let libdbus abort? considering that e_dbus really has no > magic-number checking and typechecking it in (like evas etc.) and is much > more > of a thin wrapper/glue on top of libdbus... why should it NOT abort() to > let > you know you have a bug in your code (when that is going to be its general > behavior on invalid input in general given the rest of its code)? > > > > Hello, > > > > I maintain app where e_dbus library is used. I have a > question > > about e_dbus_request_name function. > > > > Right now, If NULL is passed instead of name parameter, I receive > SIGABRT > > signal. > > > > Is it good idea to add null check in the e_dbus_request_name to > solve > > described issue? > > > > I have prepared my patch proposal. > > > > Please find the patch in the attachment. > > > > BR, > > > > Zbigniew KosiÄšski > > [SeenTimeChecker? > > do=aeeb1c78fe711860d6befb1b5493e2fd8e12c4c191378bc1313406b2 > > > > c31e47e33340d63f25e1a292b9d1af7a86c82c9092fee5c9a9e95c0389fe2928b38d2252d476 > > dc49b3e68b37d6600ca1ffd9c3fdf6ddc9ea09393184cf878f9a26ce15a0] > -- > ------------- Codito, ergo sum - "I code, therefore I am" -------------- > The Rasterman (Carsten Haitzler) ras...@rasterman.com > > > > > > [SeenTimeChecker?do=aeeb1c78fe71186007abd0de9302376d444de66cbd22f100313406b2 > > c31e47e33340d63f25e1a292b9d1af7a86c82c9092fee5c9a9e95c0389fe2928b38d2252d476 > dc49b3e68b37d6600ca1ffd9c3fdf6ddc9ea09393184cf878f9a26ce15a0] > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel >
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel