bugGNU Wget - Bugs: bug #29898, Unterminated C string in...

 
 

bug #29898: Unterminated C string in http_atotm()

Submitted by:  Noël Köthe <nok>
Submitted on:  Mon 17 May 2010 02:50:20 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: Giuseppe Scrivano <gscrivano>
Originator Name: Open/Closed: Closed
Release: 1.12Operating System: GNU/Linux
Reproducibility: NoneFixed Release: None
Planned Release: NoneRegression: None
Work Required: NonePatch Included: Yes

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 17 May 2010 02:50:20 PM UTC, original submission:

http_atotm() does not copy the terminating NUL character of the locale string. The following patch should fix this.

(l < sizeof savedlocale holds at this point, so l is at most 254, and there is room for NUL character, if I'm not mistaken.)

It's probably easier to just use xstrdup, by the way.

commit 1182dcd947bc5718af6a1c797a79487607fcfc9f
Author: Florian Weimer <fw@deneb.enyo.de>
Date: Sun May 16 11:57:52 2010 +0200

http_atotm(): also copy terminating NUL character

diff --git a/src/http.c b/src/http.c
index 15e1caf..e7dc830 100644
--- a/src/http.c
+++ b/src/http.c
@@ -2928,7 +2928,7 @@ http_atotm (const char *time_string)
if (l >= sizeof savedlocale)
savedlocale[0] = '\0';
else
- memcpy (savedlocale, oldlocale, l);
+ memcpy (savedlocale, oldlocale, l + 1);
}
else savedlocale[0] = '\0';

forwarded from http://bugs.debian.org/581817

Noël Köthe <nok>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gscrivano (Updated the item)
  • -unavailable- added by nok (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 23 May 2010 08:58:29 AM UTCgscrivanoStatusNone=>Fixed
      Assigned toNone=>gscrivano
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1