New submission from Matteo Cafasso:

The following code snippet:

----------------------------------------------
#include <stdio.h>
#include <Python.h>

int main()
{
    char *broken_string[8];
    char broken_char = 4294967252;

    sprintf(broken_string, "%c", broken_char);

    PyUnicode_FromString(broken_string);
}
----------------------------------------------

Produces a Segmentation Fault.

Is this behaviour the expected one? 

The real life example comes when reading a malformed path on a Ext4 filesystem. 
The read string causes PyUnicode_FromString to segfault.

----------
components: Extension Modules
messages: 283777
nosy: noxdafox
priority: normal
severity: normal
status: open
title: Segmentation fault when using PyUnicode_FromString
type: crash
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29039>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to