Mageia Bugzilla – Attachment 5274 Details for
Bug 13701
file crashes with segmentation fault
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
rediffed version of the patch from the above comment that also applies
file-5.12-leak_fix.patch (text/plain), 687 bytes, created by
Zoltan Balaton
on 2014-07-09 17:12:04 CEST
(
hide
)
Description:
rediffed version of the patch from the above comment that also applies
Filename:
MIME Type:
Creator:
Zoltan Balaton
Created:
2014-07-09 17:12:04 CEST
Size:
687 bytes
patch
obsolete
>diff -up file-5.12/src/softmagic.c.leak_fix file-5.12/src/softmagic.c >--- file-5.12/src/softmagic.c.leak_fix 2014-07-09 16:51:19.680927634 +0200 >+++ file-5.12/src/softmagic.c 2014-07-09 16:54:50.582912717 +0200 >@@ -1702,10 +1702,14 @@ mget(struct magic_set *ms, const unsigne > rbuf = ms->o.buf; > ms->o.buf = sbuf; > if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && >- file_printf(ms, m->desc, offset) == -1) >+ file_printf(ms, m->desc, offset) == -1) { >+ free(rbuf); > return -1; >- if (file_printf(ms, "%s", rbuf) == -1) >+ } >+ if (file_printf(ms, "%s", rbuf) == -1) { >+ free(rbuf); > return -1; >+ } > free(rbuf); > } else > ms->o.buf = sbuf;
diff -up file-5.12/src/softmagic.c.leak_fix file-5.12/src/softmagic.c --- file-5.12/src/softmagic.c.leak_fix 2014-07-09 16:51:19.680927634 +0200 +++ file-5.12/src/softmagic.c 2014-07-09 16:54:50.582912717 +0200 @@ -1702,10 +1702,14 @@ mget(struct magic_set *ms, const unsigne rbuf = ms->o.buf; ms->o.buf = sbuf; if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && - file_printf(ms, m->desc, offset) == -1) + file_printf(ms, m->desc, offset) == -1) { + free(rbuf); return -1; - if (file_printf(ms, "%s", rbuf) == -1) + } + if (file_printf(ms, "%s", rbuf) == -1) { + free(rbuf); return -1; + } free(rbuf); } else ms->o.buf = sbuf;
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 13701
: 5274