diff options
author | glewis <glewis@FreeBSD.org> | 2009-04-02 00:14:41 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2009-04-02 00:14:41 +0800 |
commit | 3dacfdbbf28e211d12285ae21963e0ee26ceb16b (patch) | |
tree | 6b63c8a0951017f31e24336fd31aa1ed9169e002 /x11-clocks | |
parent | 61604dde2dcb1cf099a1f27dc4bb1a51549391b0 (diff) | |
download | freebsd-ports-gnome-3dacfdbbf28e211d12285ae21963e0ee26ceb16b.tar.gz freebsd-ports-gnome-3dacfdbbf28e211d12285ae21963e0ee26ceb16b.tar.zst freebsd-ports-gnome-3dacfdbbf28e211d12285ae21963e0ee26ceb16b.zip |
. Fix a buffer overrun on start up.
Diffstat (limited to 'x11-clocks')
-rw-r--r-- | x11-clocks/astzclock/Makefile | 2 | ||||
-rw-r--r-- | x11-clocks/astzclock/files/patch-color | 78 |
2 files changed, 79 insertions, 1 deletions
diff --git a/x11-clocks/astzclock/Makefile b/x11-clocks/astzclock/Makefile index f7755eb75d3d..1a155e353305 100644 --- a/x11-clocks/astzclock/Makefile +++ b/x11-clocks/astzclock/Makefile @@ -7,7 +7,7 @@ PORTNAME= astzclock PORTVERSION= 1.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-clocks afterstep MASTER_SITES= http://www.eyesbeyond.com/freebsddom/astzclock/ diff --git a/x11-clocks/astzclock/files/patch-color b/x11-clocks/astzclock/files/patch-color new file mode 100644 index 000000000000..38169ae349c1 --- /dev/null +++ b/x11-clocks/astzclock/files/patch-color @@ -0,0 +1,78 @@ +$FreeBSD$ + +--- astzclock.c ++++ astzclock.c 2008-11-30 23:32:41.000000000 -0800 +@@ -302,8 +302,8 @@ + static char **clock_xpm; + XColor col; + XWindowAttributes attributes; +- char led1[22]; +- char led2[22]; ++ char led1[64]; ++ char led2[64]; + int ret; + + clock_xpm =ONLYSHAPE ? mask_xpm : clk_xpm; +@@ -317,51 +317,49 @@ + nocolor("parse",LedColor); + } + +- sprintf(&led1[0], ". c #%4X%4X%4X", col.red, col.green, col.blue); +- for(ret=10;ret<22;ret++) +- if(led1[ret]==' ') led1[ret]='0'; +- led_xpm[2] = &led1[0]; ++ sprintf(led1, ". c #%04X%04X%04X", col.red, col.green, col.blue); ++ led_xpm[2] = led1; + + col.red = (col.red /10) *3; + col.green = (col.green/10) *3; + col.blue = (col.blue /10) *3; +- sprintf(&led2[0], "X c #%4X%4X%4X", col.red, col.green, col.blue); +- for(ret=10;ret<22;ret++) +- if(led2[ret]==' ') led2[ret]='0'; +- led_xpm[3] = &led2[0]; ++ sprintf(led2, "X c #%04X%04X%04X", col.red, col.green, col.blue); ++ led_xpm[3] = led2; + + asclock.attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + ret = XpmCreatePixmapFromData(dpy, Root, clock_xpm, &asclock.pixmap, + &asclock.mask, &asclock.attributes); + if(ret != XpmSuccess) +- {fprintf(stderr, ERR_colorcells);exit(1);} ++ {fprintf(stderr, "1: %s\n", XpmGetErrorString(ret));exit(1);} + visible.attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + ret = XpmCreatePixmapFromData(dpy, Root, clk_xpm, &visible.pixmap, + &visible.mask, &visible.attributes); ++ if(ret != XpmSuccess) ++ {fprintf(stderr, "2: %s\n", XpmGetErrorString(ret));exit(1);} + + led.attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + ret = XpmCreatePixmapFromData(dpy, Root, led_xpm, &led.pixmap, + &led.mask, &led.attributes); + if(ret != XpmSuccess) +- {fprintf(stderr, ERR_colorcells);exit(1);} ++ {fprintf(stderr, "3: %s\n", XpmGetErrorString(ret));exit(1);} + + month.attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + ret = XpmCreatePixmapFromData(dpy, Root, month_xpm, &month.pixmap, + &month.mask, &month.attributes); + if(ret != XpmSuccess) +- {fprintf(stderr, ERR_colorcells);exit(1);} ++ {fprintf(stderr, "4: %s\n", XpmGetErrorString(ret));exit(1);} + + date.attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + ret = XpmCreatePixmapFromData(dpy, Root, date_xpm, &date.pixmap, + &date.mask, &date.attributes); + if(ret != XpmSuccess) +- {fprintf(stderr, ERR_colorcells);exit(1);} ++ {fprintf(stderr, "5: %s\n", XpmGetErrorString(ret));exit(1);} + + weekday.attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + ret = XpmCreatePixmapFromData(dpy, Root, weekday_xpm, &weekday.pixmap, + &weekday.mask, &weekday.attributes); + if(ret != XpmSuccess) +- {fprintf(stderr, ERR_colorcells);exit(1);} ++ {fprintf(stderr, "6: %s\n", XpmGetErrorString(ret));exit(1);} + } + /****************************************************************************/ + /* Removes expose events for a specific window from the queue */ |