Skip to content

Commit

Permalink
PR/454: Fix memory corruption when the continuation level jumps by mo…
Browse files Browse the repository at this point in the history
…re than

20 in a single step.
  • Loading branch information
zoulasc committed Jun 3, 2015
1 parent b6e8437 commit 6713ca4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "file.h"

#ifndef lint
FILE_RCSID("@(#)$File: funcs.c,v 1.80 2015/01/02 21:29:39 christos Exp $")
FILE_RCSID("@(#)$File: funcs.c,v 1.81 2015/05/28 19:26:59 christos Exp $")
#endif /* lint */

#include "magic.h"
Expand Down Expand Up @@ -416,7 +416,7 @@ file_check_mem(struct magic_set *ms, unsigned int level)
size_t len;

if (level >= ms->c.len) {
len = (ms->c.len += 20) * sizeof(*ms->c.li);
len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
malloc(len) :
realloc(ms->c.li, len));
Expand Down

6 comments on commit 6713ca4

@fgeek
Copy link

@fgeek fgeek commented on 6713ca4 Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CVE request in oss-security mailing list can be seen in http://www.openwall.com/lists/oss-security/2016/04/11/7 (url here for cross-reference).

@glensc
Copy link
Member

@glensc glensc commented on 6713ca4 Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please re-post that to mailinglist of open new item bugtracker. this repo is just git mirror (read the description!)

@glensc
Copy link
Member

@glensc glensc commented on 6713ca4 Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems it's already resolved in 5.23, http://bugs.gw.com/view.php?id=522

@fgeek
Copy link

@fgeek fgeek commented on 6713ca4 Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I posted the link here to have cross-reference.

@glensc
Copy link
Member

@glensc glensc commented on 6713ca4 Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then you should had said so, not just post only link!

@fgeek
Copy link

@fgeek fgeek commented on 6713ca4 Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I will remember to do so next time. Have a nice week.

Please sign in to comment.