Commit Graph

34 Commits

Author SHA1 Message Date
Andrei Zmievski
e1ee6322bb MFB 2009-01-12 19:15:07 +00:00
Scott MacVicar
36660c01ab Add asprintf, use regular system malloc and free and add checks in configure.in for the functions 2008-11-27 19:45:16 +00:00
Scott MacVicar
a064b61971 Warnings from libmagic should be notices rather than sent to stderr, this fixes a test on Windows 2008-11-22 10:27:19 +00:00
Pierre Joye
18c13084c7 - MFB: fix VC6 build, use our own strtoi64 implementation for VC6 2008-11-07 13:12:13 +00:00
Pierre Joye
36b3f02c19 - fix build 2008-11-06 14:24:24 +00:00
Pierre Joye
510d80e388 - MFH
- add 64bit typedef support
 - fix vc6 build (1/2)
 - still broken/does not build cleanly, more to come
2008-11-06 13:56:49 +00:00
Scott MacVicar
ca77d8ae31 Fix buffer overread in libmagic and sync a skipped change from 4.26 2008-11-06 02:58:14 +00:00
Scott MacVicar
881c30db88 Update libmagic to 4.26 and add support for v6 of the magic file format. 2008-11-02 16:09:27 +00:00
Scott MacVicar
6978fff657 Fix a stat on a null when the internal database is used. 2008-10-22 16:34:17 +00:00
Scott MacVicar
be09b491da When using the internal database and there is an error it could try free some invalid things. This was causing a bus error on ppc. 2008-10-22 13:59:08 +00:00
Scott MacVicar
df2b71d2ca Fix bug #46331 - The internal magic db is const memory and segfaults when you try to do byte swapping
on big endian machines. This fixes it by copying the memory for those processors, but this isn't ideal as
it wastes memory. Perhaps using a static cache would be better.
2008-10-20 23:35:47 +00:00
Ilia Alshanetsky
9219be30f4 MFB: removed dead-code 2008-10-15 22:57:22 +00:00
Derick Rethans
194577d7a6 - Fixed mime-type generation.
#- Charset markers need to be prepended with ; -- the tests were also wrong.
2008-10-08 09:44:12 +00:00
Felipe Pena
4fc7e69dd5 - Fixed bug #46071 (finfo_open() segfaults with wrong file name on BSD) 2008-09-16 22:21:40 +00:00
Felipe Pena
ac3ae236ec - MFB:
- use php's stream in libmagic
  - remove duplicate code (like mime_content_type() compatibility function
    now use the same base as finfo_file())
  - make it portable (works now on windows too, belongs other OSes)

  - don't close caller streams in libmagic (prevent leak and zombie stream)
  - string returned by magic_* are freed on magic_close, duplicate before
    calling magic_close (set return value)
  - if stat failed, don't try to call magic_* (when FILEINFO_MODE_FILE)
2008-09-07 20:29:54 +00:00
Felipe Pena
6051053c58 - Fix build 2008-09-07 04:17:22 +00:00
Ilia Alshanetsky
7a6170b389 MFB: removed unused variables 2008-09-06 21:32:32 +00:00
Derick Rethans
07633881bd - Some more cleanups, and fixed some warnings. 2008-08-29 12:05:35 +00:00
Antony Dovgal
914f8ceb09 fix invalid read
weird, the code uses correct order of checks just ten lines below
2008-08-29 10:53:07 +00:00
Antony Dovgal
2fbc38c67e fix ZTS build 2008-08-29 10:10:56 +00:00
Antony Dovgal
f6b3447c34 fix build 2008-08-29 10:08:30 +00:00
Scott MacVicar
83abc6c537 MFB: Replace ereg code with pcre, fix duplicate macro names and segfault. Patch by Mikko 2008-08-29 09:50:57 +00:00
Felipe Pena
4eaaf7be83 - Fixed crash in file_error_core() 2008-08-27 00:16:11 +00:00
Ilia Alshanetsky
caa3217c68 MFB:
Upgraded the lib to use PHP memory allocation routines.
	Fixed a crash caused by analysis of DEADJOE files
	A little bit of CS inside libmagic
2008-08-26 12:24:12 +00:00
Antony Dovgal
6dca1deb52 fix compilation on AIX 2008-08-10 19:48:48 +00:00
Scott MacVicar
0b88f59125 get fileinfo building again on Windows 2008-07-31 00:32:25 +00:00
Derick Rethans
0192c570c8 - No C++ comments. 2008-07-25 08:18:34 +00:00
Derick Rethans
1371ec3fbf - Fixed size calculation.
- Reverted cosmetic fixes that makes upgrading harder.
2008-07-25 08:16:03 +00:00
Antony Dovgal
231bafaade we don't do fstat, hence st struct is uninitalized 2008-07-24 14:53:59 +00:00
Antony Dovgal
54e1d048cd silence compile warning 2008-07-24 14:45:53 +00:00
Antony Dovgal
29bb0c9dd3 drop freeing of uninitialized variable
add missing return
nuke unused variable
2008-07-24 14:30:58 +00:00
Derick Rethans
8c8b504bc4 - Bundle the data file - you can still use the external file if you
specify that in the call to finfo_open().
2008-07-24 13:40:21 +00:00
Jani Taskinen
f58f634618 - Enable bundled library 2008-07-11 14:49:45 +00:00
Derick Rethans
74947e562e - Move lib to libmagic 2008-07-11 14:13:50 +00:00