Comments (12)
This seems to happen for each POST route
from sipi.
SIPI server crashes when receiving a POST request with the header "Content-Type: application/x-www-form-urlencoded"
from sipi.
in commit 29e675c, in shttps/Connection.cpp
, the following lines were removed:
if ((bodybuf = (char *) malloc((content_length + 1)*sizeof(char))) == NULL) {
- throw Error(__file__, __LINE__, "malloc failed!", errno);
- }
- ins->read(bodybuf, content_length);
- if (ins->fail() ||ins->eof()) {
- free(bodybuf);
- throw -1;
- }
- bodybuf[content_length] = '\0';
from sipi.
as a consequence, bodybuf
may be NULL
:
if (content_length > 0) {
vector<string> content_type_opts = process_header_value(header_in["content-type"]);
if (content_type_opts[0] == "application/x-www-form-urlencoded") {
char *bodybuf = NULL;
if (_chunked_transfer_in) {
ChunkReader ckrd(ins);
(void) ckrd.readAll(&bodybuf);
}
else {
}
string body = bodybuf;
post_params = parse_query_string(body, true);
request_params.insert(post_params.begin(), post_params.end());
free(bodybuf);
}
from sipi.
Starting program: /Users/tobi/gitreps/Sipi-github/local/bin/sipi -config config/sipi.config.lua
[New Thread 0x1313 of process 3268]
[New Thread 0x1403 of process 3268]
Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x1313 of process 3268]
0x00007fff8ff4d152 in strlen () from /usr/lib/system/libsystem_c.dylib
(gdb) backtrace
#0 0x00007fff8ff4d152 in strlen () from /usr/lib/system/libsystem_c.dylib
#1 0x000000010003b005 in std::__1::char_traits<char>::length(char const*) ()
#2 0x00000001004a0dec in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string (this=0x7000000fc6c0, __s=0x0)
at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:2005
#3 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string (
this=0x7000000fc6c0, __s=0x0)
at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:2003
#4 shttps::Connection::Connection (this=0x700000100608, server_p=0x7fff5fbff310, ins_p=0x700000100a18,
os_p=0x700000100968, tmpdir_p=..., buf_size=0, buf_inc=8192)
at /Users/tobi/gitreps/Sipi-github/lib/shttps/Connection.cpp:480
#5 0x00000001004ac0ad in shttps::Connection::Connection (this=0x700000100608, server_p=0x7fff5fbff310,
ins_p=0x700000100a18, os_p=0x700000100968, tmpdir_p=..., buf_size=0, buf_inc=8192)
at /Users/tobi/gitreps/Sipi-github/lib/shttps/Connection.cpp:361
#6 0x00000001004ed6d4 in shttps::Server::processRequest (this=0x7fff5fbff310, sock=6, peer_ip=..., peer_port=49883)
at /Users/tobi/gitreps/Sipi-github/lib/shttps/Server.cpp:597
#7 0x00000001004ed0a9 in shttps::process_request (arg=0x100e000a0)
at /Users/tobi/gitreps/Sipi-github/lib/shttps/Server.cpp:427
#8 0x00007fff9609099d in ?? () from /usr/lib/system/libsystem_pthread.dylib
#9 0x0000000000001103 in ?? ()
#10 0x0000700000104000 in ?? ()
#11 0x0000700000103f50 in ?? ()
#12 0x00007fff9609091a in ?? () from /usr/lib/system/libsystem_pthread.dylib
#13 0x0000000000000000 in ?? ()
from sipi.
Hallo Tobias,
ja, da ist was schief gelaufen. Habe den Code mit malloc wieder rein getan. Bin am testen..
Liebe Grüsse,
Lukas
Prof. Dr. Lukas Rosenthaler
Head of "Digital Humanities Lab",
University of Basel
Bernoullistrasse 32
CH-4056 Basel, Switzerland
Tel: + 41 61 267 0490
Fax: +41 61 267 3855
http://www.dhlab.unibas.ch
On 20 Jun 2016, at 18:52, Tobias Schweizer [email protected] wrote:
as a consequence, bodybuf may be NULL:
if (content_length > 0) {
vector content_type_opts = process_header_value(header_in["content-type"]);
if (content_type_opts[0] == "application/x-www-form-urlencoded") {
char *bodybuf = NULL;
if (_chunked_transfer_in) {
ChunkReader ckrd(ins);
(void) ckrd.readAll(&bodybuf);
}
else {
}
string body = bodybuf;
post_params = parse_query_string(body, true);
request_params.insert(post_params.begin(), post_params.end());free(bodybuf); }
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub #33 (comment), or mute the thread https://github.com/notifications/unsubscribe/AFN9zN-qP5T4DuSDRdHDvHL8HLd-pVo5ks5qNsUxgaJpZM4I5pXO.
from sipi.
Habe mich zunächst nur gewundert, warum da keine POST params mehr sind im Lua script :-)
from sipi.
ok, openssl
branch you have committed your fix to works for me now.
Now this should be fixed in develop
to
from sipi.
I’ll do it :-)
Prof. Dr. Lukas Rosenthaler
Head of "Digital Humanities Lab",
University of Basel
Bernoullistrasse 32
CH-4056 Basel, Switzerland
Tel: + 41 61 267 0490
Fax: +41 61 267 3855
http://www.dhlab.unibas.ch
On 21 Jun 2016, at 00:28, Tobias Schweizer [email protected] wrote:
ok, openssl branch you have committed your fix to works for me now.
Now this should be fixed in develop to
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub #33 (comment), or mute the thread https://github.com/notifications/unsubscribe/AFN9zOxkSQwJuwF_oplJ96eaqJSIUWvWks5qNxQqgaJpZM4I5pXO.
from sipi.
great :-)
from sipi.
solved?
from sipi.
Solved
from sipi.
Related Issues (20)
- Broken sipi.io documentation link HOT 1
- /knora.json doesn't work with a CSV file HOT 11
- sipi.io returns 404
- Any route beginning with 'test' returns a PDF file containing a test image HOT 1
- mimetype_consistency should also work with non-image files HOT 2
- No response when uploading certain PDF files HOT 10
- question: controlling iiif parameters HOT 4
- Update documentation HOT 5
- make compile fails HOT 3
- color management in tiled images HOT 1
- Kakadu error when uploading PNG image
- OpenJPEG support HOT 3
- Automation of the documentation HOT 1
- caching strategy HOT 1
- Enabling CORS everywhere HOT 1
- Lua integration server.cookies does not return multiple cookies (DEV-2300) HOT 1
- Image cannot be processed HOT 1
- HTTP OPTIONS request returns invalid content HOT 1
- Images in sub-sub folders: Too many "/"
- Watermark not apply in SIPI docker version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sipi.