Patch for the bug on remove_sep().

From: Ding Yi Chen <>
Date: Mon, 23 Nov 2009 23:11:43 -0500 (EST)


I am using gob2 to develop various projects such as WritRecogn, ibus-chewing, and MakerDialog.
Recently I found that those project are failed to compile. After investigation, I think the problem
might reside in remove_sep(), src/util.c.

In remove_sep(), the code that remove ':' is:

        while((p = strchr(s, ':')))
                strcpy(p, p+1);

However, according to the man page of strcpy:
   "The strings may not overlap, and the destination string dest must be
       large enough to receive the copy."

In fact, this code block produces unexpected results in some systems.
For example:
  Ma:Class is converted to Ma:Clsss
  Ma:Placement is converted to Ma:Plccemnnt

The patch that address this issue is attached.


Ding-Yi Chen
Software Engineer
Internationalization Group
Red Hat, Inc.
Register now for Red Hat Virtual Experience, December 9.
Enterprise Linux, virtualization, cloud, and more.

Received on Mon Nov 23 2009 - 22:11:51 CST

This archive was generated by hypermail 2.2.0 : Sun Apr 17 2011 - 21:05:02 CDT