From: YAMAMOTO Mitsuharu Date: Thu, 14 Jul 2005 09:23:12 +0000 (+0000) Subject: (get_scrap_target_type_list): Avoid NULL pointer dereference. X-Git-Tag: emacs-pretest-22.0.90~8156 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=10b8ef61c0f25060b2d1f865ba85edf62a207881;p=emacs.git (get_scrap_target_type_list): Avoid NULL pointer dereference. --- diff --git a/src/macselect.c b/src/macselect.c index b519950eb75..94fe591a206 100644 --- a/src/macselect.c +++ b/src/macselect.c @@ -371,7 +371,7 @@ get_scrap_target_type_list (scrap) err = GetScrapFlavorCount (scrap, &count); if (err == noErr) flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count); - if (err == noErr && flavor_info) + if (flavor_info) { err = GetScrapFlavorInfoList (scrap, &count, flavor_info); if (err != noErr) @@ -380,6 +380,8 @@ get_scrap_target_type_list (scrap) flavor_info = NULL; } } + if (flavor_info == NULL) + count = 0; #endif for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest)) {