mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
To: musl@lists.openwall.com
Cc: Natanael ncopa Copa <ncopa@alpinelinux.org>
Subject: segfault on sscanf
Date: Thu, 14 Mar 2019 10:46:17 +0100	[thread overview]
Message-ID: <20190314104617.711ac7d8@faultier2go> (raw)

[-- 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 --]

             reply	other threads:[~2019-03-14  9:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14  9:46 Marian Buschsieweke [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190314104617.711ac7d8@faultier2go \
    --to=marian.buschsieweke@ovgu.de \
    --cc=musl@lists.openwall.com \
    --cc=ncopa@alpinelinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).