• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • Simple HTTPD
  • Bugs

[patch] don't allocate URI_MAX arrays on the heap

Brought to you by: drozd
  • Summary
  • Files
  • Reviews
  • Support
  • Bugs
  • News
  • Code
  • Mailing Lists
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#51 [patch] don't allocate URI_MAX arrays on the heap

open
nobody
None
5
2008-08-26
2008-08-26
Anonymous
No

Downstream ticket:
http://trac.transmissionbt.com/ticket/1217

Background: Transmission is processing some pretty large request, so I increased the IO buffers size in the "Set IO buffers" section of add_socket() by increasing the value of URI_MAX.

Unfortunately when I increased this to 64k, it appears to be smashing the stack because there are a couple of places in shttpd where a char array of URI_MAX bytes is allocated.

Issue #1: decouple the dual use of URI_MAX, and add a separate #define in config.h to set the IO buffer size. (Though, it looks like this won't be necessary in your redesign.)

Issue #2: you may want to consider allocating those buffers on the heap instead of on the stack. The downstream ticket has a 1.42 patch to do this, and also avoids some minor overhead in the logging code.

Discussion

  • Nobody/Anonymous

    Nobody/Anonymous - 2008-08-26

    Logged In: NO

    The patch:
    http://trac.transmissionbt.com/attachment/ticket/1217/uri-heap.2.diff

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
auth0 logo