Yeah. u'r right.
I added some checking routines. thanks

PS: could you change your default mail mode to txt? or just set to not
convert ">" as "&gt"?

On Tue, May 22, 2012 at 1:22 PM, ChunEon Park <her...@naver.com> wrote:
> It missed simple null checking after malloc.
>
>
> + char *stripstr = malloc(sizeof(char) * (data-&gt;length + 1));+ 
> strncpy(stripstr, (char *)data-&gt;data, data-&gt;length);
>
>
> ------------------------------------
>
> -Regards, Hermet-
>
>
> -----Original Message-----
> From: "Enlightenment SVN"&lt;no-re...@enlightenment.org&gt;
> To: &lt;enlightenment-...@lists.sourceforge.net&gt;;
> Cc:
> Sent: 2012-05-22 (화) 10:35:13
> Subject: E SVN: hyoyoung trunk/elementary/src/lib
>
> Log:
> elementary/cnp: add null terminating at handling html type
>
>  Signed-off-by: Michal Pakula vel Rutka &lt;m.pakula&gt;@samsung.com&gt;
>
>
> Author:       hyoyoung
> Date:         2012-05-21 18:35:12 -0700 (Mon, 21 May 2012)
> New Revision: 71291
> Trac:         http://trac.enlightenment.org/e/changeset/71291
>
> Modified:
>  trunk/elementary/src/lib/elm_cnp.c
>
> Modified: trunk/elementary/src/lib/elm_cnp.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_cnp.c  2012-05-21 16:55:29 UTC (rev 71290)
> +++ trunk/elementary/src/lib/elm_cnp.c  2012-05-22 01:35:12 UTC (rev 71291)
> @@ -978,21 +978,21 @@
>
>    cnp_debug("Got some HTML: Checking encoding is useful\n");
>    data = notify-&gt;data;
> +   char *stripstr = malloc(sizeof(char) * (data-&gt;length + 1));
> +   strncpy(stripstr, (char *)data-&gt;data, data-&gt;length);
> +   stripstr[data-&gt;length] = '\0';
>
>    if (sel-&gt;datacb)
>      {
>         Elm_Selection_Data ddata;
>         ddata.x = ddata.y = 0;
>         ddata.format = ELM_SEL_FORMAT_HTML;
> -        ddata.data = data-&gt;data;
> +        ddata.data = stripstr;
>         ddata.len = data-&gt;length;
>         sel-&gt;datacb(sel-&gt;udata, sel-&gt;widget, &amp;ddata);
>         return 0;
>      }
>
> -   char *stripstr = malloc(sizeof(char) * (data-&gt;length + 1));
> -   strncpy(stripstr, (char *)data-&gt;data, data-&gt;length);
> -   stripstr[data-&gt;length] = '\0';
>    cnp_debug("String is %s (%d bytes)\n", stripstr, data-&gt;length);
>    _elm_entry_entry_paste(sel-&gt;requestwidget, stripstr);
>    free(stripstr);
>
>
> ------------------------------------------------------------------------------
> 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-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
>
>
> ------------------------------------------------------------------------------
> 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

Reply via email to