From fa471bfaaf967006c4749ee7b9b845aac51276f0 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 25 Jul 2013 16:58:26 +0200 Subject: [PATCH] * include/grub/video.h (grub_video_register): Keep double-linked as well as single-linked invariants. Reported by: qwertial. --- ChangeLog | 6 ++++++ include/grub/video.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7b987f832..df966d021 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-07-25 Vladimir Serbinenko + + * include/grub/video.h (grub_video_register): Keep double-linked as + well as single-linked invariants. + Reported by: qwertial. + 2013-07-25 Vladimir Serbinenko * grub-core/commands/nativedisk.c (get_uuid): Handle diff --git a/include/grub/video.h b/include/grub/video.h index c444536bf..5dd99c136 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -400,6 +400,10 @@ grub_video_register (grub_video_adapter_t adapter) p = &((*p)->next)); adapter->next = *p; *p = adapter; + + adapter->prev = p; + if (adapter->next) + adapter->next->prev = &adapter->next; } #endif