From 0b6bcb565e7f514c09bcd1c7b44d3e1bc8791e32 Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 17 Jul 2015 20:36:56 -0400 Subject: [PATCH] Fixed a hardware-stack leak. --- libsrc/common/vsnprintf.s | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libsrc/common/vsnprintf.s b/libsrc/common/vsnprintf.s index 01bcd6406..228e531d0 100644 --- a/libsrc/common/vsnprintf.s +++ b/libsrc/common/vsnprintf.s @@ -2,7 +2,7 @@ ; int __fastcall__ vsnprintf (char* Buf, size_t size, const char* Format, va_list ap); ; ; 2009-09-26, Ullrich von Bassewitz -; 2015-07-09, Greg King +; 2015-07-17, Greg King ; .export _vsnprintf, vsnprintf @@ -131,12 +131,15 @@ L4: lda ccount+0 ; Bail out if size is too high. -L9: lda #ERANGE +L9: ldy #ERANGE .byte $2C ;(bit $xxxx) ; NULL buffer pointers usually are invalid. -L0: lda #EINVAL +L0: ldy #EINVAL + pla ; Drop ap + pla + tya jsr __directerrno ; Return -1 jmp incsp6 ; Drop parameters -- 2.39.5