Menu

#20 Dereferencing a possible NULL Pointer without NULL check in uri.c

v1.0 (example)
closed-invalid
nobody
None
5
2015-12-27
2015-11-09
No

Version : libmms-0.6.4
file : uri.c
line no : 193, 307, 340, 370 and 563
NULL check is missing on pointer before dereferencing it.

Variable 'guri' is dereferenced at uri.c:193, calloc is used at line no 185 for memory allocation that can return NULL. There are similar insidance at line no 307, 340, 370 and 563

Please check attached patch(uri.patch) to fix these issues.

Discussion

  • Hans de Goede

    Hans de Goede - 2015-11-19

    Hi,

    It looks like you've forgotten to attach a patch to this bug report.

    Regards,

    Hans

     
  • mahendra Narvariya

    Hi,

    Please find attached patch file(uri.patch).

    Regards,
    Mahendra

     
  • Hans de Goede

    Hans de Goede - 2015-12-27
    • status: open --> closed-invalid
     
  • Hans de Goede

    Hans de Goede - 2015-12-27

    Hi,

    g_new and gmalloc cannot fail (they will abort() rather then return NULL, so there is no need for the error checking this patch adds.

    Regards,

    Hans

     

Log in to post a comment.