[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#771738: apt-get segfaults on '[' in sources.list



Package: apt
Version: 1.0.9.3
Severity: minor


If sources.list contains a [ in it, it will segfault. Likely true for ] too, but I haven't tried.


> # cat /etc/apt/sources.list [eb
> http://ppa.launchpad.net/banshee-team/ppa/ubuntu trusty main deb-src
> http://ppa.launchpad.net/banshee-team/ppa/ubuntu trusty main 
> # sudo apt-get update Segmentation fault 


From gdb:
> 0x00007ffff7b17247 in pkgSourceList::ReadAppend(std::string) () from
> /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 (gdb) bt #0
> 0x00007ffff7b17247 in pkgSourceList::ReadAppend(std::string) () from
> /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 #1 0x00007ffff7b17b54 in
> pkgSourceList::ReadMainList() () from
> /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 #2 0x00007ffff7b3ad41 in
> pkgCacheFile::BuildSourceList(OpProgress*) () from
> /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 #3 0x0000000000414770 in
> DoUpdate(CommandLine&) () at apt-get.cc:1617 #4 0x00007ffff7af12a3 in
> CommandLine::DispatchArg(CommandLine::Dispatch*, bool) () from
> /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 #5 0x00000000004093d3 in
> main () at apt-get.cc:3523 



Broken code is likely in sourcelist.cc, here:
> char *I; // CNC:2003-02-20 - Do not break if '#' is inside []. for (I
> = Buffer; *I != 0 && *I != '#'; I++) if (*I == '[') I = strchr(I + 1,
> ']'); *I = 0; 



Thanks,

-- 
-- Joshua Rogers <https://internot.info/>

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: