<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 18: Dereferencing a possible NULL Pointer without NULL check in mmc.c</title><link>https://sourceforge.net/p/libmms/bugs/18/</link><description>Recent changes to 18: Dereferencing a possible NULL Pointer without NULL check in mmc.c</description><atom:link href="https://sourceforge.net/p/libmms/bugs/18/feed.rss" rel="self"/><language>en</language><lastBuildDate>Sat, 07 Nov 2015 11:17:10 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/libmms/bugs/18/feed.rss" rel="self" type="application/rss+xml"/><item><title>Dereferencing a possible NULL Pointer without NULL check in mmc.c</title><link>https://sourceforge.net/p/libmms/bugs/18/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Version : libmms-0.6.4&lt;br/&gt;
file : mms.c&lt;br/&gt;
line no : 731&lt;br/&gt;
NULL check is missing on pointer before dereferencing it.&lt;br/&gt;
In file mms.c, calloc is being used for memory allocation and retured pointer is assigned to variable ‘this’.&lt;br/&gt;
Variable 'this' is dereferenced  in file mms.c at line no 731, with null check.&lt;/p&gt;
&lt;p&gt;Current code :&lt;/p&gt;
&lt;p&gt;this = (mms_t*)calloc(1, sizeof(mms_t));&lt;/p&gt;
&lt;p&gt;this-&amp;gt;url  =  strdup (url);&lt;br/&gt;
this-&amp;gt;s  =  -1;&lt;/p&gt;
&lt;p&gt;Suggested code :&lt;/p&gt;
&lt;p&gt;this = (mms_t*)calloc(1, sizeof(mms_t));&lt;br/&gt;
  if (!this) {&lt;br/&gt;
    lprintf("error, calloc failed\n");&lt;br/&gt;
    return NULL;&lt;br/&gt;
  }&lt;/p&gt;
&lt;p&gt;this-&amp;gt;url  =  strdup (url);&lt;br/&gt;
  this-&amp;gt;s  =  -1;&lt;/p&gt;
&lt;p&gt;Please check the attached patch.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mahendra Narvariya</dc:creator><pubDate>Sat, 07 Nov 2015 11:17:10 -0000</pubDate><guid>https://sourceforge.net730a78dd817b8d6b19b5ae9ea1d83c49f2b6e2cd</guid></item></channel></rss>