aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/randr
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/randr')
-rw-r--r--nx-X11/programs/Xserver/randr/rrcrtc.c8
-rw-r--r--nx-X11/programs/Xserver/randr/rroutput.c2
-rw-r--r--nx-X11/programs/Xserver/randr/rrprovider.c4
-rw-r--r--nx-X11/programs/Xserver/randr/rrscreen.c6
4 files changed, 12 insertions, 8 deletions
diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c
index 59a3f446a..1034eac5d 100644
--- a/nx-X11/programs/Xserver/randr/rrcrtc.c
+++ b/nx-X11/programs/Xserver/randr/rrcrtc.c
@@ -1018,6 +1018,7 @@ ProcRRGetCrtcInfo(ClientPtr client)
mode = crtc->mode;
+ memset(&rep, 0, sizeof(xRRGetCrtcInfoReply));
rep = (xRRGetCrtcInfoReply) {
.type = X_Reply,
.status = RRSetConfigSuccess,
@@ -1055,7 +1056,7 @@ ProcRRGetCrtcInfo(ClientPtr client)
extraLen = rep.length << 2;
if (extraLen) {
- extra = malloc(extraLen);
+ extra = calloc(1, extraLen);
if (!extra)
return BadAlloc;
}
@@ -1313,6 +1314,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
sendReply:
free(outputs);
+ memset(&rep, 0, sizeof(xRRSetCrtcConfigReply));
rep = (xRRSetCrtcConfigReply) {
.type = X_Reply,
.status = status,
@@ -1354,6 +1356,7 @@ ProcRRGetPanning(ClientPtr client)
if (!pScrPriv)
return RRErrorBase + BadRRCrtc;
+ memset(&rep, 0, sizeof(xRRGetPanningReply));
rep = (xRRGetPanningReply) {
.type = X_Reply,
.status = RRSetConfigSuccess,
@@ -1453,6 +1456,7 @@ ProcRRSetPanning(ClientPtr client)
status = RRSetConfigSuccess;
sendReply:
+ memset(&rep, 0, sizeof(xRRSetPanningReply));
rep = (xRRSetPanningReply) {
.type = X_Reply,
.status = status,
@@ -1517,7 +1521,7 @@ ProcRRGetCrtcGamma(ClientPtr client)
len = crtc->gammaSize * 3 * 2;
if (crtc->gammaSize) {
- extra = malloc(len);
+ extra = calloc(1, len);
if (!extra)
return BadAlloc;
}
diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c
index c4da7d534..5235f39d7 100644
--- a/nx-X11/programs/Xserver/randr/rroutput.c
+++ b/nx-X11/programs/Xserver/randr/rroutput.c
@@ -494,7 +494,7 @@ ProcRRGetOutputInfo(ClientPtr client)
if (extraLen) {
rep.length += bytes_to_int32(extraLen);
- extra = malloc(extraLen);
+ extra = calloc(1, extraLen);
if (!extra)
return BadAlloc;
}
diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c
index 0ac9474c6..1f884a7b2 100644
--- a/nx-X11/programs/Xserver/randr/rrprovider.c
+++ b/nx-X11/programs/Xserver/randr/rrprovider.c
@@ -120,7 +120,7 @@ ProcRRGetProviders(ClientPtr client)
};
extraLen = rep.length << 2;
if (extraLen) {
- extra = malloc(extraLen);
+ extra = calloc(1, extraLen);
if (!extra)
return BadAlloc;
} else
@@ -215,7 +215,7 @@ ProcRRGetProviderInfo(ClientPtr client)
extraLen = rep.length << 2;
if (extraLen) {
- extra = malloc(extraLen);
+ extra = calloc(1, extraLen);
if (!extra)
return BadAlloc;
}
diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c
index 1a30b29d4..4f59e9aea 100644
--- a/nx-X11/programs/Xserver/randr/rrscreen.c
+++ b/nx-X11/programs/Xserver/randr/rrscreen.c
@@ -457,7 +457,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
extraLen = rep.length << 2;
if (extraLen) {
- extra = malloc(extraLen);
+ extra = calloc(1,extraLen);
if (!extra) {
return BadAlloc;
}
@@ -595,7 +595,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
extraLen = rep.length << 2;
if (extraLen) {
- extra = malloc(extraLen);
+ extra = calloc(1, extraLen);
if (!extra) {
free(modes);
return BadAlloc;
@@ -873,7 +873,7 @@ ProcRRGetScreenInfo(ClientPtr client)
extraLen += rep.nrateEnts * sizeof(CARD16);
if (extraLen) {
- extra = (CARD8 *) malloc(extraLen);
+ extra = (CARD8 *) calloc(1, extraLen);
if (!extra) {
free(pData);
return BadAlloc;