Skip to content

snprintf with overlapping source and dest strings #1061

Description

@michaelortmann

egg_snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks, newnick);

snprintf with overlapping source and dest strings is undefined behaviour, dst is char * restrict.

After inserting debug code i was able to see a real bug here.

I found this with #1028, but Will Buckner also found this before me in 2005:

http://lists.eggheads.org/pipermail/eggdev/2005-April/015490.html

He mentioned a patch, but i checked eggdrops commit history and this patch never made it into eggdrop.

My attempt to contact Mr. Buckner failed due to his old email address being not valid anymore.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions