mailing list of musl libc
 help / color / mirror / code / Atom feed
* segfault on sscanf
@ 2019-03-14  9:46 Marian Buschsieweke
  2019-03-14 12:44 ` A. Wilcox
  2019-03-14 16:28 ` Markus Wichmann
  0 siblings, 2 replies; 15+ messages in thread
From: Marian Buschsieweke @ 2019-03-14  9:46 UTC (permalink / raw)
  To: musl; +Cc: Natanael ncopa Copa

[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]

Hi,

running pdflatex on Alpine Linux for a specific document resulted in a
segfault, which I could trace down to a specific call to sscanf. This is a
minimum example to reproduce that segfault:

	#include <stdio.h>
	
	int main(void) {
		const char *too_parse = "0 1 -1 0";
		double f1,f2,f3,f4;
		char dummy;
		sscanf(too_parse, " %lf %lf %lf %lf %c", &f1, &f2, &f3, &f4, &dummy);
	
		printf("f1=%f, f2=%f, f3=%f, f4=%f, dummy=\"%c\"\n", f1, f2, f3, f4, dummy);
	
		return 0;
	}

This is the backtrace:

	#0  0x00007ffff7fb7eba in vfscanf (f=f@entry=0x7fffffffe6f8, 
	    fmt=<optimized out>, ap=ap@entry=0x7fffffffe7f8) at src/stdio/vfscanf.c:262
	#1  0x00007ffff7fb971a in vsscanf (s=<optimized out>, fmt=<optimized out>, 
	    ap=ap@entry=0x7fffffffe7f8) at src/stdio/vsscanf.c:14
	#2  0x00007ffff7fb594d in sscanf (s=<optimized out>, fmt=<optimized out>)
	    at src/stdio/sscanf.c:9
	#3  0x0000555555555213 in main () at test.c:7

I have the package Alpine Linux package musl-1.1.21-r0 installed, which is musl
version 1.1.21 with minimal changes.

Kind regards,
Marian

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-03-15  1:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14  9:46 segfault on sscanf Marian Buschsieweke
2019-03-14 12:44 ` A. Wilcox
2019-03-14 13:29   ` Szabolcs Nagy
2019-03-14 14:34     ` Pascal Cuoq
2019-03-14 16:28 ` Markus Wichmann
2019-03-14 16:53   ` Markus Wichmann
2019-03-14 18:19     ` Szabolcs Nagy
2019-03-14 18:38       ` Markus Wichmann
2019-03-14 19:49         ` Szabolcs Nagy
2019-03-14 20:15           ` Szabolcs Nagy
2019-03-14 22:34           ` Rich Felker
2019-03-14 22:43             ` Szabolcs Nagy
2019-03-14 22:52               ` Rich Felker
2019-03-15  1:54                 ` Rich Felker
2019-03-14 22:40   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).