-2016-06-02 7.0.1-9 Cristy <quetzlzacatenango@image...>
- * Release ImageMagick version 7.0.1-9, GIT revision 18341:f4a35c3:20160602.
-
2016-06-02 7.0.1-9 Cristy <quetzlzacatenango@image...>
* Fix small memory leak (patch provided by Андрей Черный).
* Coder path traversal is not authorized (bug report provided by
*magic='\0';
GetPathComponent(image_info->filename,MagickPath,magic);
if (*magic == '\0')
- (void) CopyMagickString(magic,image_info->magick,MagickPathExtent);
+ {
+ (void) CopyMagickString(magic,image_info->magick,MagickPathExtent);
+ magick_info=GetMagickInfo(magic,sans_exception);
+ }
else
{
/*
User specified image format.
*/
LocaleUpper(magic);
- if (IsMagickConflict(magic) == MagickFalse)
+ magick_info=GetMagickInfo(magic,sans_exception);
+ if ((magick_info != (const MagickInfo *) NULL) &&
+ (IsMagickConflict(magic) == MagickFalse))
{
(void) CopyMagickString(image_info->magick,magic,MagickPathExtent);
image_info->affirm=MagickTrue;
}
}
- magick_info=GetMagickInfo(magic,sans_exception);
sans_exception=DestroyExceptionInfo(sans_exception);
if ((magick_info == (const MagickInfo *) NULL) ||
(GetMagickEndianSupport(magick_info) == MagickFalse))
image_info->endian=UndefinedEndian;
- GetPathComponent(image_info->filename,CanonicalPath,component);
- (void) CopyMagickString(image_info->filename,component,MagickPathExtent);
+ if (image_info->affirm != MagickFalse)
+ {
+ GetPathComponent(image_info->filename,CanonicalPath,component);
+ (void) CopyMagickString(image_info->filename,component,MagickPathExtent);
+ }
if ((image_info->adjoin != MagickFalse) && (frames > 1))
{
/*
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);
assert(path != (char *) NULL);
assert(exception != (ExceptionInfo *) NULL);
+ if (strchr(filename,'/') != (char *) NULL)
+ return(MagickFalse);
(void) CopyMagickString(path,filename,MagickPathExtent);
-#if defined(MAGICKCORE_INSTALLED_SUPPORT)
- if (strstr(path,"../") != (char *) NULL)
- {
- errno=EPERM;
- (void) ThrowMagickException(exception,GetMagickModule(),PolicyError,
- "NotAuthorized","`%s'",path);
- return(MagickFalse);
- }
-#endif
module_path=(char *) NULL;
switch (module_type)
{